mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 19:05:16 +00:00
Fix formatting
This commit is contained in:
1 parent
7ff539c5cd
commit
53facd1f5f
13 files changed
+87
-26
No files matched your search
@@ -9,10 +9,10 @@
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
@@ -26,11 +26,13 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistryEntry;
|
||||
|
||||
import vazkii.botania.common.crafting.AbstractElvenTradeRecipe;
|
||||
import vazkii.botania.common.crafting.ModRecipeTypes;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.command.arguments.BlockStateParser;
|
||||
@@ -32,11 +32,13 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistryEntry;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.crafting.ModRecipeTypes;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class RecipeManaInfusion implements IRecipe<IInventory> {
|
||||
@@ -130,6 +132,7 @@ public class RecipeManaInfusion implements IRecipe<IInventory> {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
return false;
|
||||
|
||||
@@ -26,8 +26,8 @@ public class RegisterRecipesEvent extends Event {
|
||||
private final Consumer<RecipeRuneAltar> runeAltar;
|
||||
|
||||
public RegisterRecipesEvent(Consumer<RecipePureDaisy> pureDaisy,
|
||||
Consumer<RecipeBrew> brew,
|
||||
Consumer<RecipePetals> apothecary, Consumer<RecipeRuneAltar> runeAltar) {
|
||||
Consumer<RecipeBrew> brew,
|
||||
Consumer<RecipePetals> apothecary, Consumer<RecipeRuneAltar> runeAltar) {
|
||||
this.pureDaisy = pureDaisy;
|
||||
this.brew = brew;
|
||||
this.apothecary = apothecary;
|
||||
|
||||
@@ -274,9 +274,9 @@ public class TileAlfPortal extends TileMod implements ITickableTileEntity {
|
||||
|
||||
public static List<AbstractElvenTradeRecipe> elvenTradeRecipes(RecipeManager rm) {
|
||||
return rm.getRecipes(ModRecipeTypes.ELVEN_TRADE_TYPE).values().stream()
|
||||
.filter(r -> r instanceof AbstractElvenTradeRecipe)
|
||||
.map(r -> (AbstractElvenTradeRecipe) r)
|
||||
.collect(Collectors.toList());
|
||||
.filter(r -> r instanceof AbstractElvenTradeRecipe)
|
||||
.map(r -> (AbstractElvenTradeRecipe) r)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void resolveRecipes() {
|
||||
|
||||
@@ -151,9 +151,9 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
|
||||
public static List<RecipeManaInfusion> manaInfusionRecipes(RecipeManager rm) {
|
||||
return rm.getRecipes(ModRecipeTypes.MANA_INFUSION_TYPE).values().stream()
|
||||
.filter(r -> r instanceof RecipeManaInfusion)
|
||||
.map(r -> (RecipeManaInfusion) r)
|
||||
.collect(Collectors.toList());
|
||||
.filter(r -> r instanceof RecipeManaInfusion)
|
||||
.map(r -> (RecipeManaInfusion) r)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public RecipeManaInfusion getMatchingRecipe(@Nonnull ItemStack stack, @Nonnull BlockState state) {
|
||||
|
||||
@@ -11,6 +11,7 @@ package vazkii.botania.common.core.helper;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mojang.datafixers.Dynamic;
|
||||
import com.mojang.datafixers.types.JsonOps;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.INBT;
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* This class is distributed as part of the Botania Mod.
|
||||
* Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.common.crafting;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -9,9 +17,11 @@ import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* This class is distributed as part of the Botania Mod.
|
||||
* Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.common.crafting;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -5,11 +13,13 @@ import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ItemLexicon;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*
|
||||
* This class is distributed as part of the Botania Mod.
|
||||
* Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.common.crafting;
|
||||
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
@@ -9,6 +17,7 @@ import net.minecraft.util.registry.Registry;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.api.recipe.RecipePureDaisy;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class SyncHandler {
|
||||
|
||||
RegisterRecipesEvent evt = new RegisterRecipesEvent(
|
||||
r -> pureDaisy.put(r.getId(), r),
|
||||
r -> brew.put(r.getId(), r),
|
||||
r -> brew.put(r.getId(), r),
|
||||
r -> apothecary.put(r.getId(), r),
|
||||
r -> runeAltar.put(r.getId(), r)
|
||||
);
|
||||
@@ -64,7 +64,7 @@ public class SyncHandler {
|
||||
|
||||
private static PacketSyncRecipes syncPacket() {
|
||||
return new PacketSyncRecipes(BotaniaAPI.brewRecipes,
|
||||
BotaniaAPI.petalRecipes, BotaniaAPI.pureDaisyRecipes, BotaniaAPI.runeAltarRecipes);
|
||||
BotaniaAPI.petalRecipes, BotaniaAPI.pureDaisyRecipes, BotaniaAPI.runeAltarRecipes);
|
||||
}
|
||||
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID, value = Dist.CLIENT)
|
||||
|
||||
@@ -98,7 +98,7 @@ public class PacketSyncRecipes {
|
||||
|
||||
public Login() {
|
||||
this(new PacketSyncRecipes(BotaniaAPI.brewRecipes, BotaniaAPI.petalRecipes,
|
||||
BotaniaAPI.pureDaisyRecipes, BotaniaAPI.runeAltarRecipes));
|
||||
BotaniaAPI.pureDaisyRecipes, BotaniaAPI.runeAltarRecipes));
|
||||
}
|
||||
|
||||
public Login(PacketSyncRecipes packet) {
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
/*
|
||||
* This class is distributed as part of the Botania Mod.
|
||||
* Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.data;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.data.CustomRecipeBuilder;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
@@ -13,6 +22,7 @@ import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -22,6 +32,7 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.ModTags;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -77,6 +88,7 @@ public class ElvenTradeProvider extends RecipeProvider {
|
||||
public FinishedRecipe(ResourceLocation id, ItemStack output, Ingredient... inputs) {
|
||||
this(id, Arrays.asList(inputs), Collections.singletonList(output));
|
||||
}
|
||||
|
||||
private FinishedRecipe(ResourceLocation id, List<Ingredient> inputs, List<ItemStack> outputs) {
|
||||
this.id = id;
|
||||
this.inputs = inputs;
|
||||
@@ -110,12 +122,14 @@ public class ElvenTradeProvider extends RecipeProvider {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override public JsonObject getAdvancementJson() {
|
||||
@Override
|
||||
public JsonObject getAdvancementJson() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override public ResourceLocation getAdvancementID() {
|
||||
@Override
|
||||
public ResourceLocation getAdvancementID() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
/*
|
||||
* This class is distributed as part of the Botania Mod.
|
||||
* Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*/
|
||||
package vazkii.botania.data;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
@@ -17,6 +26,7 @@ import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.Tags;
|
||||
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
@@ -26,6 +36,7 @@ import vazkii.botania.common.crafting.ModRecipeTypes;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -140,8 +151,8 @@ public class ManaInfusionProvider extends RecipeProvider {
|
||||
|
||||
// NB: No wither rose is intentional
|
||||
cycle(consumer, 400, "botania:flower_cycle", Blocks.DANDELION, Blocks.POPPY, Blocks.BLUE_ORCHID, Blocks.ALLIUM, Blocks.AZURE_BLUET, Blocks.RED_TULIP, Blocks.ORANGE_TULIP,
|
||||
Blocks.WHITE_TULIP, Blocks.PINK_TULIP, Blocks.OXEYE_DAISY, Blocks.CORNFLOWER, Blocks.LILY_OF_THE_VALLEY,
|
||||
Blocks.SUNFLOWER, Blocks.LILAC, Blocks.ROSE_BUSH, Blocks.PEONY);
|
||||
Blocks.WHITE_TULIP, Blocks.PINK_TULIP, Blocks.OXEYE_DAISY, Blocks.CORNFLOWER, Blocks.LILY_OF_THE_VALLEY,
|
||||
Blocks.SUNFLOWER, Blocks.LILAC, Blocks.ROSE_BUSH, Blocks.PEONY);
|
||||
|
||||
consumer.accept(FinishedRecipe.alchemy(id("chorus_fruit_to_flower"), new ItemStack(Blocks.CHORUS_FLOWER), ingr(Items.POPPED_CHORUS_FRUIT), 10000));
|
||||
|
||||
@@ -197,7 +208,7 @@ public class ManaInfusionProvider extends RecipeProvider {
|
||||
private static ResourceLocation id(String s) {
|
||||
return prefix("mana_infusion/" + s);
|
||||
}
|
||||
|
||||
|
||||
private static Ingredient ingr(IItemProvider i) {
|
||||
return Ingredient.fromItems(i);
|
||||
}
|
||||
@@ -208,8 +219,7 @@ public class ManaInfusionProvider extends RecipeProvider {
|
||||
private final ItemStack output;
|
||||
private final int mana;
|
||||
private final String group;
|
||||
@Nullable
|
||||
private final BlockState catalyst;
|
||||
@Nullable private final BlockState catalyst;
|
||||
|
||||
public static FinishedRecipe conjuration(ResourceLocation id, ItemStack output, Ingredient input, int mana) {
|
||||
return new FinishedRecipe(id, output, input, mana, "", ModBlocks.conjurationCatalyst.getDefaultState());
|
||||
@@ -226,11 +236,11 @@ public class ManaInfusionProvider extends RecipeProvider {
|
||||
public FinishedRecipe(ResourceLocation id, ItemStack output, Ingredient input, int mana) {
|
||||
this(id, output, input, mana, "");
|
||||
}
|
||||
|
||||
|
||||
public FinishedRecipe(ResourceLocation id, ItemStack output, Ingredient input, int mana, String group) {
|
||||
this(id, output, input, mana, group, null);
|
||||
}
|
||||
|
||||
|
||||
public FinishedRecipe(ResourceLocation id, ItemStack output, Ingredient input, int mana, String group, @Nullable BlockState catalyst) {
|
||||
this.id = id;
|
||||
this.input = input;
|
||||
@@ -253,7 +263,7 @@ public class ManaInfusionProvider extends RecipeProvider {
|
||||
if (catalyst != catalyst.getBlock().getDefaultState()) {
|
||||
catalystStr.append('[');
|
||||
catalystStr.append(catalyst.getProperties().stream().map(prop -> prop.getName() + "=" + getName(prop, catalyst.get(prop)))
|
||||
.collect(Collectors.joining(",")));
|
||||
.collect(Collectors.joining(",")));
|
||||
catalystStr.append(']');
|
||||
}
|
||||
json.addProperty("catalyst", catalystStr.toString());
|
||||
@@ -261,7 +271,7 @@ public class ManaInfusionProvider extends RecipeProvider {
|
||||
}
|
||||
|
||||
private static <T extends Comparable<T>> String getName(IProperty<T> prop, Comparable<?> val) {
|
||||
return prop.getName((T)val);
|
||||
return prop.getName((T) val);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -275,12 +285,14 @@ public class ManaInfusionProvider extends RecipeProvider {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override public JsonObject getAdvancementJson() {
|
||||
@Override
|
||||
public JsonObject getAdvancementJson() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override public ResourceLocation getAdvancementID() {
|
||||
@Override
|
||||
public ResourceLocation getAdvancementID() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user