mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 11:53:29 +01:00
possibly finally fixed that recipe tag issue
This commit is contained in:
parent
d7b795d58a
commit
a21f32a4b3
3 changed files with 29 additions and 4 deletions
|
@ -82,7 +82,6 @@ public final class NaturesAura {
|
|||
|
||||
ModRegistry.init();
|
||||
DrainSpotEffects.init();
|
||||
DeferredWorkQueue.runLater(ModRecipes::init);
|
||||
|
||||
proxy.init(event);
|
||||
}
|
||||
|
|
|
@ -12,9 +12,13 @@ import de.ellpeck.naturesaura.chunk.AuraChunkProvider;
|
|||
import de.ellpeck.naturesaura.commands.CommandAura;
|
||||
import de.ellpeck.naturesaura.misc.WorldData;
|
||||
import de.ellpeck.naturesaura.packet.PacketHandler;
|
||||
import de.ellpeck.naturesaura.recipes.ModRecipes;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.profiler.IProfiler;
|
||||
import net.minecraft.resources.IFutureReloadListener;
|
||||
import net.minecraft.resources.IResourceManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -28,12 +32,15 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
|||
import net.minecraftforge.event.world.ChunkWatchEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import net.minecraftforge.fml.event.server.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public class CommonEvents {
|
||||
|
||||
|
@ -126,7 +133,12 @@ public class CommonEvents {
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerAboutToStartEvent(FMLServerStartingEvent event) {
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
CommandAura.register(event.getCommandDispatcher());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
event.getServer().getResourceManager().addReloadListener(new ModRecipes());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import de.ellpeck.naturesaura.misc.ColoredBlockHelper;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.FlowerBlock;
|
||||
import net.minecraft.client.resources.ReloadListener;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.passive.SheepEntity;
|
||||
|
@ -24,6 +25,8 @@ import net.minecraft.item.Items;
|
|||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.potion.PotionUtils;
|
||||
import net.minecraft.potion.Potions;
|
||||
import net.minecraft.profiler.IProfiler;
|
||||
import net.minecraft.resources.IResourceManager;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -33,9 +36,9 @@ import net.minecraftforge.registries.ForgeRegistries;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class ModRecipes {
|
||||
public class ModRecipes extends ReloadListener<Object> {
|
||||
|
||||
public static void init() {
|
||||
private void init() {
|
||||
new TreeRitualRecipe(res("eye"),
|
||||
ing(new ItemStack(Blocks.OAK_SAPLING)), new ItemStack(ModItems.EYE), 250,
|
||||
ing(Items.SPIDER_EYE),
|
||||
|
@ -391,4 +394,15 @@ public final class ModRecipes {
|
|||
private static ResourceLocation res(String name) {
|
||||
return new ResourceLocation(NaturesAura.MOD_ID, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object prepare(IResourceManager resourceManagerIn, IProfiler profilerIn) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void apply(Object splashList, IResourceManager resourceManagerIn, IProfiler profilerIn) {
|
||||
NaturesAura.LOGGER.info("Loading recipes");
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue