mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-26 05:08:34 +01:00
fixed recipes not being loaded properly when reloading
This commit is contained in:
parent
79e1997d1d
commit
32c62cbc50
4 changed files with 16 additions and 4 deletions
|
@ -1,11 +1,12 @@
|
||||||
package de.ellpeck.naturesaura.compat.crafttweaker;
|
package de.ellpeck.naturesaura.compat.crafttweaker;
|
||||||
|
|
||||||
import com.blamejared.crafttweaker.api.actions.IAction;
|
import com.blamejared.crafttweaker.api.actions.IAction;
|
||||||
|
import com.blamejared.crafttweaker.api.actions.IRuntimeAction;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class AddAction<T> implements IAction {
|
public class AddAction<T> implements IRuntimeAction {
|
||||||
|
|
||||||
private final Map<ResourceLocation, T> registry;
|
private final Map<ResourceLocation, T> registry;
|
||||||
private final ResourceLocation res;
|
private final ResourceLocation res;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package de.ellpeck.naturesaura.compat.crafttweaker;
|
package de.ellpeck.naturesaura.compat.crafttweaker;
|
||||||
|
|
||||||
import com.blamejared.crafttweaker.api.actions.IAction;
|
import com.blamejared.crafttweaker.api.actions.IAction;
|
||||||
|
import com.blamejared.crafttweaker.api.actions.IRuntimeAction;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
|
@ -8,7 +9,7 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class RemoveAction implements IAction {
|
public class RemoveAction implements IRuntimeAction {
|
||||||
private final Map<ResourceLocation, ?> registry;
|
private final Map<ResourceLocation, ?> registry;
|
||||||
private final List<ResourceLocation> recipes;
|
private final List<ResourceLocation> recipes;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ public class ClientProxy implements IProxy {
|
||||||
ScreenManager.registerFactory(ModContainers.ENDER_ACCESS, GuiEnderCrate::new);
|
ScreenManager.registerFactory(ModContainers.ENDER_ACCESS, GuiEnderCrate::new);
|
||||||
|
|
||||||
IResourceManager manager = Minecraft.getInstance().getResourceManager();
|
IResourceManager manager = Minecraft.getInstance().getResourceManager();
|
||||||
if (manager instanceof IReloadableResourceManager)
|
|
||||||
((IReloadableResourceManager) manager).addReloadListener(new ModRecipes());
|
((IReloadableResourceManager) manager).addReloadListener(new ModRecipes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,17 @@ import java.util.Arrays;
|
||||||
public class ModRecipes extends ReloadListener<Object> {
|
public class ModRecipes extends ReloadListener<Object> {
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
|
// Clear all registries first
|
||||||
|
NaturesAuraAPI.TREE_RITUAL_RECIPES.clear();
|
||||||
|
NaturesAuraAPI.ALTAR_RECIPES.clear();
|
||||||
|
NaturesAuraAPI.OFFERING_RECIPES.clear();
|
||||||
|
NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.clear();
|
||||||
|
NaturesAuraAPI.FLOWERS.clear();
|
||||||
|
NaturesAuraAPI.ANIMAL_SPAWNER_RECIPES.clear();
|
||||||
|
NaturesAuraAPI.OVERWORLD_ORES.clear();
|
||||||
|
NaturesAuraAPI.NETHER_ORES.clear();
|
||||||
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.clear();
|
||||||
|
|
||||||
new TreeRitualRecipe(res("eye"),
|
new TreeRitualRecipe(res("eye"),
|
||||||
ing(new ItemStack(Blocks.OAK_SAPLING)), new ItemStack(ModItems.EYE), 250,
|
ing(new ItemStack(Blocks.OAK_SAPLING)), new ItemStack(ModItems.EYE), 250,
|
||||||
ing(Items.SPIDER_EYE),
|
ing(Items.SPIDER_EYE),
|
||||||
|
|
Loading…
Reference in a new issue