Jump to content

[1.12.2] Help with custom crafting table & chests (using wood OreDict)


Kitteh6660

Recommended Posts

I've got nearly every thing up and running with my MoreCraft mod after days of painstakingly converting every recipe and integrating advancement functionality to my mod.

It's almost ready but I've came across obstacles. I couldn't seem to be able to have the JSONs take priority over vanilla recipes when it comes to using ore dictionary.

 

While the mod NoMoreRecipeConflict works, that's only a band-aid solution. I could remove the ore dict but then the Netherwood planks can no longer be used in every wooden crafting recipe universally, and that would cripple cross-mod crafting functionality. I want to make sure the ore dict remains but properly fix the recipes. Back in 1.11.2, I had no problems as the coded recipes easily takes priority over the vanilla recipes.

The expected behaviour. Clicking the Netherwood chest without the required planks produces the expected chest on output. The recipe is registered.

PFIdsth.png -

The results. It creates an ordinary chest. For some reasons the mod recipe doesn't take priority over the vanilla recipe. This is the same case for Netherwood Crafting Table (which uses vanilla crafting functionality)

QOLgB9n.png

 

Spoiler

netherwood_chest.json


{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "###",
    "# #",
    "###"
  ],
  "key": {
    "#": {
      "item": "morecraft:netherwood_planks"
    }
  },
  "result": {
    "item": "morecraft:netherwood_chest"
  }
}

netherwood_crafting_table.json


{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "##",
    "##"
  ],
  "key": {
    "#": {
      "item": "morecraft:netherwood_planks"
    }
  },
  "result": {
    "item": "morecraft:netherwood_crafting_table"
  }
}

Snippet from MoreCraft.java


    public static void oreRegistration()
    {
    	//|--| Register blocks to Ore Dictionary |--|\\
		OreDictionary.registerOre("blockGlass", MoreCraftBlocks.SOUL_GLASS);
		OreDictionary.registerOre("blockGlassColorless", MoreCraftBlocks.SOUL_GLASS);
		OreDictionary.registerOre("paneGlass", MoreCraftBlocks.SOUL_GLASS_PANE);
		OreDictionary.registerOre("paneGlassColorless", MoreCraftBlocks.SOUL_GLASS_PANE);
    	
		//Ruby ores and blocks
		OreDictionary.registerOre("oreRuby", MoreCraftBlocks.RUBY_ORE);
		OreDictionary.registerOre("blockRuby", MoreCraftBlocks.RUBY_BLOCK);
		
		//Netherwood
		OreDictionary.registerOre("treeWood", MoreCraftBlocks.NETHERWOOD_LOG);
		OreDictionary.registerOre("plankWood", MoreCraftBlocks.NETHERWOOD_PLANKS);
		OreDictionary.registerOre("stairWood", MoreCraftBlocks.NETHERWOOD_STAIRS);
		OreDictionary.registerOre("slabWood", MoreCraftBlocks.NETHERWOOD_SLAB);
		OreDictionary.registerOre("treeLeaves", MoreCraftBlocks.NETHERWOOD_LEAVES);
		OreDictionary.registerOre("treeSapling", MoreCraftBlocks.NETHERWOOD_SAPLING);
		
		//Blocks made from vanilla resources.
		OreDictionary.registerOre("blockFlesh", MoreCraftBlocks.FLESH_BLOCK);
		OreDictionary.registerOre("blockGunpowder", MoreCraftBlocks.GUNPOWDER_BLOCK);
		OreDictionary.registerOre("blockBlaze", MoreCraftBlocks.BLAZE_BLOCK);
		OreDictionary.registerOre("blockEnder", MoreCraftBlocks.ENDER_BLOCK);
		
		//|--| Register items to Ore Dictionary |--|\\
		OreDictionary.registerOre("gemRuby", MoreCraftItems.RUBY);
		OreDictionary.registerOre("boneWither", MoreCraftItems.WITHER_BONE);
		OreDictionary.registerOre("scaleEnder", MoreCraftItems.ENDERDRAGON_SCALES);
    }

 

Is there a solution to ensure that OreDict'ed ingredients are exempt from certain recipes? I've been trying to make everything done as simple as possible.

Edited by Kitteh6660
Correction of text placement
Link to comment
Share on other sites

4 hours ago, Kitteh6660 said:

I've got nearly every thing up and running with my MoreCraft mod after days of painstakingly converting every recipe and integrating advancement functionality to my mod.

It's almost ready but I've came across obstacles. I couldn't seem to be able to have the JSONs take priority over vanilla recipes when it comes to using ore dictionary.

 

While the mod NoMoreRecipeConflict works, that's only a band-aid solution. I could remove the ore dict but then the Netherwood planks can no longer be used in every wooden crafting recipe universally, and that would cripple cross-mod crafting functionality. I want to make sure the ore dict remains but properly fix the recipes. Back in 1.11.2, I had no problems as the coded recipes easily takes priority over the vanilla recipes.

The expected behaviour. Clicking the Netherwood chest without the required planks produces the expected chest on output. The recipe is registered.

PFIdsth.png -

The results. It creates an ordinary chest. For some reasons the mod recipe doesn't take priority over the vanilla recipe. This is the same case for Netherwood Crafting Table (which uses vanilla crafting functionality)

QOLgB9n.png

 

  Reveal hidden contents

netherwood_chest.json



{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "###",
    "# #",
    "###"
  ],
  "key": {
    "#": {
      "item": "morecraft:netherwood_planks"
    }
  },
  "result": {
    "item": "morecraft:netherwood_chest"
  }
}

netherwood_crafting_table.json



{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "##",
    "##"
  ],
  "key": {
    "#": {
      "item": "morecraft:netherwood_planks"
    }
  },
  "result": {
    "item": "morecraft:netherwood_crafting_table"
  }
}

Snippet from MoreCraft.java



    public static void oreRegistration()
    {
    	//|--| Register blocks to Ore Dictionary |--|\\
		OreDictionary.registerOre("blockGlass", MoreCraftBlocks.SOUL_GLASS);
		OreDictionary.registerOre("blockGlassColorless", MoreCraftBlocks.SOUL_GLASS);
		OreDictionary.registerOre("paneGlass", MoreCraftBlocks.SOUL_GLASS_PANE);
		OreDictionary.registerOre("paneGlassColorless", MoreCraftBlocks.SOUL_GLASS_PANE);
    	
		//Ruby ores and blocks
		OreDictionary.registerOre("oreRuby", MoreCraftBlocks.RUBY_ORE);
		OreDictionary.registerOre("blockRuby", MoreCraftBlocks.RUBY_BLOCK);
		
		//Netherwood
		OreDictionary.registerOre("treeWood", MoreCraftBlocks.NETHERWOOD_LOG);
		OreDictionary.registerOre("plankWood", MoreCraftBlocks.NETHERWOOD_PLANKS);
		OreDictionary.registerOre("stairWood", MoreCraftBlocks.NETHERWOOD_STAIRS);
		OreDictionary.registerOre("slabWood", MoreCraftBlocks.NETHERWOOD_SLAB);
		OreDictionary.registerOre("treeLeaves", MoreCraftBlocks.NETHERWOOD_LEAVES);
		OreDictionary.registerOre("treeSapling", MoreCraftBlocks.NETHERWOOD_SAPLING);
		
		//Blocks made from vanilla resources.
		OreDictionary.registerOre("blockFlesh", MoreCraftBlocks.FLESH_BLOCK);
		OreDictionary.registerOre("blockGunpowder", MoreCraftBlocks.GUNPOWDER_BLOCK);
		OreDictionary.registerOre("blockBlaze", MoreCraftBlocks.BLAZE_BLOCK);
		OreDictionary.registerOre("blockEnder", MoreCraftBlocks.ENDER_BLOCK);
		
		//|--| Register items to Ore Dictionary |--|\\
		OreDictionary.registerOre("gemRuby", MoreCraftItems.RUBY);
		OreDictionary.registerOre("boneWither", MoreCraftItems.WITHER_BONE);
		OreDictionary.registerOre("scaleEnder", MoreCraftItems.ENDERDRAGON_SCALES);
    }

 

Is there a solution to ensure that OreDict'ed ingredients are exempt from certain recipes? I've been trying to make everything done as simple as possible.

I think this may be solved in 1.13 with the vanilla tag system, which (I believe) will be used instead of OreDictionary

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

8 hours ago, Kitteh6660 said:

Is there a solution to ensure that OreDict'ed ingredients are exempt from certain recipes? I've been trying to make everything done as simple as possible.

What you are going to have to do, is after all your recipes have been added, you will need to remove and re-add the recipes to the registry.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

It took me a long while of searching and eventually giving up on that but I ended up having made a solution of my own. The only downside is the output graphic looks unaltered but you will receive the items.

I tried the removing and re-adding to no avail.

Spoiler

My workaround solution. Not perfect however. You can still mix Netherwood planks + vanilla planks and get vanilla chests and crafting table, but if you use all Netherwood planks, you get the Netherwood version. It also checks if you use Shift keys, and thus prevents the infinite items exploit.

I've registered and now everything works, other than the minor graphical issue on crafting.


package kittehmod.morecraft.crafting;

import org.lwjgl.input.Keyboard;

import kittehmod.morecraft.MoreCraftBlocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;

public class RecipeHelper {
	
	//It's ugly but it'll do for now.
	public static int countItemInGrid(InventoryCrafting matrix, Item item) {
		int amt = 0;
		for (int i = 0; i < 9; i++) {
			if (matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getItem() == item) { amt++; }
		}
		System.out.println(amt);
		return amt;
	}
	public static int decreaseItemsInGrid(InventoryCrafting matrix, int amount) {
		int amt = 0;
		for (int i = 0; i < 9; i++) {
			if (matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getCount() > 0) {
				matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).shrink(amount);
			}
		}
		System.out.println(amt);
		return amt;
	}
	public static int countMultiplesLowest(InventoryCrafting matrix, Item item) {
		int amt = 99;
		for (int i = 0; i < 9; i++) {
			if (matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getCount() > 0 && amt > matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getCount() && matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getItem() == item) {
				amt = matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getCount();
			}
		}
		return amt;
	}
	private static void deductItemsFromPlayer(EntityPlayer player, Item item, int amount) {
		InventoryPlayer inventory = player.inventory;
		for (int i = 0; i < 36; i++) {
			if (inventory.getStackInSlot(i).getItem() == item) {
				inventory.decrStackSize(i, amount);
				break;
			}
		}
	}
	
	public static void processCrafting(ItemCraftedEvent event, EntityPlayer player, InventoryCrafting matrix, Item origCraft, Item targetCraft, Item materialDeducted) {
		World world = player.getEntityWorld();
		int amt = 1;
		if (!world.isRemote) { //Server handler
			event.crafting.shrink(1);
			decreaseItemsInGrid(matrix, 1);
			event.player.addItemStackToInventory(new ItemStack(targetCraft, 1));
		}
		else { //Singleplayer handler
			if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
				event.crafting.shrink(1);
				amt = countMultiplesLowest(matrix, materialDeducted);
				decreaseItemsInGrid(matrix, amt);
				deductItemsFromPlayer(event.player, origCraft, 1);
				event.player.addItemStackToInventory(new ItemStack(targetCraft, amt));
			}
			else {
				event.crafting.shrink(1);
				decreaseItemsInGrid(matrix, 1);
				event.player.addItemStackToInventory(new ItemStack(targetCraft, 1));
			}
		}
	}
	
	//Hacky workaround for Netherwood chests and crafting tables.		
	@SubscribeEvent
	public void CraftEvent(ItemCraftedEvent event)
	{
		InventoryCrafting matrix = (InventoryCrafting)event.craftMatrix;
		RecipeHelper.countItemInGrid(matrix, Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS));
		if (event.crafting.getItem() == Item.getItemFromBlock(Blocks.CHEST) && countItemInGrid(matrix, Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS)) == 8) {
			processCrafting(event, event.player, matrix, Item.getItemFromBlock(Blocks.CHEST), Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_CHEST), Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS));
		}
		else if (event.crafting.getItem() == Item.getItemFromBlock(Blocks.CRAFTING_TABLE) && countItemInGrid(matrix, Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS)) == 4) {
			processCrafting(event, event.player, matrix, Item.getItemFromBlock(Blocks.CRAFTING_TABLE), Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_CRAFTING_TABLE), Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS));
		}
	}
}

 

While it works in Single Player, I'll have to figure out a way to process multiples at a time on the server.

Edited by Kitteh6660
Link to comment
Share on other sites

7 hours ago, Kitteh6660 said:

It took me a long while of searching and eventually giving up on that but I ended up having made a solution of my own. The only downside is the output graphic looks unaltered but you will receive the items.

I tried the removing and re-adding to no avail.

  Reveal hidden contents

My workaround solution. Not perfect however. You can still mix Netherwood planks + vanilla planks and get vanilla chests and crafting table, but if you use all Netherwood planks, you get the Netherwood version. It also checks if you use Shift keys, and thus prevents the infinite items exploit.

I've registered and now everything works, other than the minor graphical issue on crafting.



package kittehmod.morecraft.crafting;

import org.lwjgl.input.Keyboard;

import kittehmod.morecraft.MoreCraftBlocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;

public class RecipeHelper {
	
	//It's ugly but it'll do for now.
	public static int countItemInGrid(InventoryCrafting matrix, Item item) {
		int amt = 0;
		for (int i = 0; i < 9; i++) {
			if (matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getItem() == item) { amt++; }
		}
		System.out.println(amt);
		return amt;
	}
	public static int decreaseItemsInGrid(InventoryCrafting matrix, int amount) {
		int amt = 0;
		for (int i = 0; i < 9; i++) {
			if (matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getCount() > 0) {
				matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).shrink(amount);
			}
		}
		System.out.println(amt);
		return amt;
	}
	public static int countMultiplesLowest(InventoryCrafting matrix, Item item) {
		int amt = 99;
		for (int i = 0; i < 9; i++) {
			if (matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getCount() > 0 && amt > matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getCount() && matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getItem() == item) {
				amt = matrix.getStackInRowAndColumn(i % 3, (int)(i/3)).getCount();
			}
		}
		return amt;
	}
	private static void deductItemsFromPlayer(EntityPlayer player, Item item, int amount) {
		InventoryPlayer inventory = player.inventory;
		for (int i = 0; i < 36; i++) {
			if (inventory.getStackInSlot(i).getItem() == item) {
				inventory.decrStackSize(i, amount);
				break;
			}
		}
	}
	
	public static void processCrafting(ItemCraftedEvent event, EntityPlayer player, InventoryCrafting matrix, Item origCraft, Item targetCraft, Item materialDeducted) {
		World world = player.getEntityWorld();
		int amt = 1;
		if (!world.isRemote) { //Server handler
			event.crafting.shrink(1);
			decreaseItemsInGrid(matrix, 1);
			event.player.addItemStackToInventory(new ItemStack(targetCraft, 1));
		}
		else { //Singleplayer handler
			if (Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
				event.crafting.shrink(1);
				amt = countMultiplesLowest(matrix, materialDeducted);
				decreaseItemsInGrid(matrix, amt);
				deductItemsFromPlayer(event.player, origCraft, 1);
				event.player.addItemStackToInventory(new ItemStack(targetCraft, amt));
			}
			else {
				event.crafting.shrink(1);
				decreaseItemsInGrid(matrix, 1);
				event.player.addItemStackToInventory(new ItemStack(targetCraft, 1));
			}
		}
	}
	
	//Hacky workaround for Netherwood chests and crafting tables.		
	@SubscribeEvent
	public void CraftEvent(ItemCraftedEvent event)
	{
		InventoryCrafting matrix = (InventoryCrafting)event.craftMatrix;
		RecipeHelper.countItemInGrid(matrix, Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS));
		if (event.crafting.getItem() == Item.getItemFromBlock(Blocks.CHEST) && countItemInGrid(matrix, Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS)) == 8) {
			processCrafting(event, event.player, matrix, Item.getItemFromBlock(Blocks.CHEST), Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_CHEST), Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS));
		}
		else if (event.crafting.getItem() == Item.getItemFromBlock(Blocks.CRAFTING_TABLE) && countItemInGrid(matrix, Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS)) == 4) {
			processCrafting(event, event.player, matrix, Item.getItemFromBlock(Blocks.CRAFTING_TABLE), Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_CRAFTING_TABLE), Item.getItemFromBlock(MoreCraftBlocks.NETHERWOOD_PLANKS));
		}
	}
}

 

While it works in Single Player, I'll have to figure out a way to process multiples at a time on the server.

If I remember correctly I never implemented this, but found a way to do it very easily.

I think that you can just modify your onCraftMatrixChanged method and use code from  net.minecraft.inventory#Container.slotChangedCraftingGrid and net.minecraft.item.crafting.CraftingManager.findMatchingRecipe.

 

Never mind, I forgot that you're using the vanilla crafting table. You just have to reshuffle the recipe registry so that your recipes are before the vanilla ones so that the for loop in net.minecraft.item.crafting.CraftingManager.findMatchingRecipe chooses your recipe and not the vanilla ones. 

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

How can I re-add? If I try to re-register the vanilla recipe, it crashes Minecraft with "already registered"

Here's the code. I looked through the dropdown and couldn't seem to find a reliable way to re-add the recipes.

Spoiler

	public static void fixCraftingRecipes() {
		IForgeRegistryModifiable<IRecipe> registry = (IForgeRegistryModifiable<IRecipe>) ForgeRegistries.RECIPES;
		if (!fixedNetherChest) {
			fixedNetherChest = true;
			IRecipe recipe = CraftingManager.getRecipe(new ResourceLocation("minecraft:chest"));
			registry.remove(recipe.getRegistryName());
			//Now how do I re-add the recipe? Register doesn't work as it crashes with "already registered"
		}
		if (!fixedNetherTable) {
			//This will be filled out
		}
	}

 

I could try the for loop, but I still feel a bit confused, and a bit of poking around to find it doesn't seem easy to have it skip over the vanilla recipes.

Link to comment
Share on other sites

1 hour ago, Kitteh6660 said:

I could try the for loop, but I still feel a bit confused, and a bit of poking around to find it doesn't seem easy to have it skip over the vanilla recipes.

Iterate over the registry for recipes. Then remove the recipes while storing them in a variable. Then add your recipes, then add the copies of the recipes you removed.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I tried the following code like you asked, but it doesn't work.

Spoiler

	//A wonky workaround to fixing Netherwood chest and crafting table recipes
	public static void fixCraftingRecipes() {
		IForgeRegistryModifiable<IRecipe> registry = (IForgeRegistryModifiable<IRecipe>) ForgeRegistries.RECIPES;
		ArrayList<IRecipe> recipes = Lists.newArrayList(registry.getValues());
		IRecipe recipeNether = CraftingManager.getRecipe(new ResourceLocation("morecraft:netherwood_chest"));
		IRecipe recipeCopy;
		for (IRecipe recipe : recipes) {
			if (recipe.getRecipeOutput().getItem() == Item.getItemFromBlock(Blocks.CHEST)) {
				recipeCopy = recipe;
				registry.remove(recipe.getRegistryName());
				registry.register(recipeNether);
				registry.register(recipeCopy);
				break;
			}
		}
	}

 

It then crashes with the following error output:

Spoiler

// Ouch. That hurt :(

Time: 8/30/18 8:16 AM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from MoreCraft (morecraft)
Caused by: java.lang.IllegalArgumentException: value already present: net.minecraft.item.crafting.ShapedRecipes@73a1a1b4
	at com.google.common.collect.HashBiMap.put(HashBiMap.java:287)
	at com.google.common.collect.HashBiMap.put(HashBiMap.java:262)
	at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:338)
	at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:285)
	at net.minecraftforge.registries.ForgeRegistry.register(ForgeRegistry.java:118)
	at kittehmod.morecraft.crafting.RecipeHelper.fixCraftingRecipes(RecipeHelper.java:121)
	at kittehmod.morecraft.MoreCraft.load(MoreCraft.java:123)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:629)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135)
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:744)
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:329)
	at net.minecraft.client.Minecraft.init(Minecraft.java:581)
	at net.minecraft.client.Minecraft.run(Minecraft.java:421)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:25)

 

I'm close to giving up on that.

Link to comment
Share on other sites

Have you tried something like (pseudo code)

 

ArrayList<> myRecipes = new ArrayList<>();

ArrayList otherRecipes = new ArrayList<>();

 

for(Recipe recipe : forgeRegistries.Recipes.allRecipesAsList()) {

if(recipeIsMine(recipe)) {

myRecipes.add(recipe);

}

else {

otherRecipes.add(recipe);

}

}

 

forgeRegistries.Recipes.allRecipesAsList().clear();

 

forgeRegistries.Recipes.allRecipesAsList().addAll(myRecipes);

 

forgeRegistries.Recipes.allRecipesAsList().addAll(otherRecipes);

 

 

sorry for the bad formatting, I wrote it on my phone

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

8 hours ago, Kitteh6660 said:

I'm close to giving up on that.

You never remove your recipe registry so why do you try to add it again?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • This honestly might just work for you @SubscribeEvent public static void onScreenRender(ScreenEvent.Render.Post event) { final var player = Minecraft.getInstance().player; if(!hasMyEffect(player)) return; // TODO: You provide hasMyEffect float f = Mth.lerp(p_109094_, this.minecraft.player.oSpinningEffectIntensity, this.minecraft.player.spinningEffectIntensity); float f1 = ((Double)this.minecraft.options.screenEffectScale().get()).floatValue(); if(f <= 0F || f1 >= 1F) return; float p_282656_ = ?; final var p_282460_ = event.getGuiGraphics(); int i = p_282460_.guiWidth(); int j = p_282460_.guiHeight(); p_282460_.pose().pushPose(); float f = Mth.lerp(p_282656_, 2.0F, 1.0F); p_282460_.pose().translate((float)i / 2.0F, (float)j / 2.0F, 0.0F); p_282460_.pose().scale(f, f, f); p_282460_.pose().translate((float)(-i) / 2.0F, (float)(-j) / 2.0F, 0.0F); float f1 = 0.2F * p_282656_; float f2 = 0.4F * p_282656_; float f3 = 0.2F * p_282656_; RenderSystem.disableDepthTest(); RenderSystem.depthMask(false); RenderSystem.enableBlend(); RenderSystem.blendFuncSeparate(SourceFactor.ONE, DestFactor.ONE, SourceFactor.ONE, DestFactor.ONE); p_282460_.setColor(f1, f2, f3, 1.0F); p_282460_.blit(NAUSEA_LOCATION, 0, 0, -90, 0.0F, 0.0F, i, j, i, j); p_282460_.setColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.defaultBlendFunc(); RenderSystem.disableBlend(); RenderSystem.depthMask(true); RenderSystem.enableDepthTest(); p_282460_.pose().popPose(); }   Note: Most of this is directly copied from GameRenderer as you pointed out you found. The only thing you'll have to likely do is update the `oSpinningEffectIntensity` + `spinningEffectIntensity` variables on the player when your effect is applied. Which values should be there? Not 100% sure, might be a game of guess and check, but `handleNetherPortalClient` in LocalPlayer has some hard coded you might be able to start with.
    • Dalam dunia perjudian online yang berkembang pesat, mencari platform yang dapat memberikan kemenangan maksimal dan hasil terbaik adalah impian setiap penjudi. OLXTOTO, dengan bangga, mempersembahkan dirinya sebagai jawaban atas pencarian itu. Sebagai platform terbesar untuk kemenangan maksimal dan hasil optimal, OLXTOTO telah menciptakan gelombang besar di komunitas perjudian online. Satu dari banyak keunggulan yang dimiliki OLXTOTO adalah koleksi permainan yang luas dan beragam. Dari togel hingga slot online, dari live casino hingga permainan kartu klasik, OLXTOTO memiliki sesuatu untuk setiap pemain. Dibangun dengan teknologi terkini dan dikembangkan oleh para ahli industri, setiap permainan di platform ini dirancang untuk memberikan pengalaman yang tak tertandingi bagi para penjudi. Namun, keunggulan OLXTOTO tidak hanya terletak pada variasi permainan yang mereka tawarkan. Mereka juga menonjol karena komitmen mereka terhadap keamanan dan keadilan. Dengan sistem keamanan tingkat tinggi dan proses audit yang ketat, OLXTOTO memastikan bahwa setiap putaran permainan berjalan dengan adil dan transparan. Para pemain dapat merasa aman dan yakin bahwa pengalaman berjudi mereka di OLXTOTO tidak akan terganggu oleh masalah keamanan atau keadilan. Tak hanya itu, OLXTOTO juga terkenal karena layanan pelanggan yang luar biasa. Tim dukungan mereka selalu siap sedia untuk membantu para pemain dengan segala pertanyaan atau masalah yang mereka hadapi. Dengan respon cepat dan solusi yang efisien, OLXTOTO memastikan bahwa pengalaman berjudi para pemain tetap mulus dan menyenangkan. Dengan semua fitur dan keunggulan yang ditawarkannya, tidak mengherankan bahwa OLXTOTO telah menjadi pilihan utama bagi jutaan penjudi online di seluruh dunia. Jika Anda mencari platform yang dapat memberikan kemenangan maksimal dan hasil optimal, tidak perlu mencari lebih jauh dari OLXTOTO. Bergabunglah dengan OLXTOTO hari ini dan mulailah petualangan Anda menuju kemenangan besar dan hasil terbaik!
    • Selamat datang di OLXTOTO, situs slot gacor terpanas yang sedang booming di industri perjudian online. Jika Anda mencari pengalaman bermain yang luar biasa, maka OLXTOTO adalah tempat yang tepat untuk Anda. Dapatkan sensasi tidak biasa dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering. Di sini, Anda akan merasakan keseruan yang luar biasa dalam bermain judi slot. DAFTAR OLXTOTO DISINI LOGIN OLXTOTO DISINI AKUN PRO OLXTOTO DISINI   Jackpot Slot Maxwin Sering Untuk Peluang Besar Di OLXTOTO, kami tidak hanya memberikan hadiah slot biasa, tapi juga memberikan kesempatan kepada pemain untuk memenangkan jackpot slot maxwin yang sering. Dengan demikian, Anda dapat meraih keberuntungan besar dan memenangkan ribuan rupiah sebagai hadiah jackpot slot maxwin kami. Jackpot slot maxwin merupakan peluang besar bagi para pemain judi slot untuk meraih keuntungan yang lebih besar. Dalam permainan kami, Anda tidak harus terpaku pada kemenangan biasa saja. Kami hadir dengan jackpot slot maxwin yang sering, sehingga Anda memiliki peluang yang lebih besar untuk meraih kemenangan besar dengan hadiah yang menggiurkan. Dalam permainan judi slot, pengalaman bermain bukan hanya tentang keseruan dan hiburan semata. Kami memahami bahwa para pemain juga menginginkan kesempatan untuk meraih keberuntungan besar. Oleh karena itu, OLXTOTO hadir dengan jackpot slot maxwin yang sering untuk memberikan peluang besar kepada para pemain kami. Peluang Besar Menang Jackpot Slot Maxwin Peluang menang jackpot slot maxwin di OLXTOTO sangatlah besar. Anda tidak perlu khawatir tentang batasan atau pembatasan dalam meraih jackpot tersebut. Kami ingin memberikan kesempatan kepada semua pemain kami untuk merasakan sensasi menang dalam jumlah yang luar biasa. Jackpot slot maxwin kami dibuka untuk semua pemain judi slot di OLXTOTO. Anda memiliki peluang yang sama dengan pemain lainnya untuk memenangkan hadiah jackpot yang besar. Kami percaya bahwa semua orang memiliki kesempatan untuk meraih keberuntungan besar, dan itulah mengapa kami menyediakan jackpot slot maxwin yang sering untuk memenuhi harapan dan keinginan Anda.   Kesimpulan OLXTOTO adalah situs slot gacor terbaik yang memberikan pengalaman bermain judi slot online yang tak terlupakan. Dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering, OLXTOTO menjadi pilihan terbaik bagi para pemain yang mencari kesenangan dan kemenangan besar dalam perjudian online. Di samping itu, OLXTOTO juga menawarkan layanan pelanggan yang ramah dan responsif, siap membantu setiap pemain dalam mengatasi masalah teknis atau pertanyaan seputar perjudian online. Kami menjaga integritas game dan memberikan lingkungan bermain yang adil serta menjalankan kebijakan perlindungan pelanggan yang cermat. Bergabunglah dengan OLXTOTO sekarang dan nikmati pengalaman bermain slot online yang luar biasa. Jadilah bagian dari komunitas perjudian yang mengagumkan ini dan raih kesempatan untuk meraih kemenangan besar. Dapatkan akses mudah dan praktis ke situs OLXTOTO dan rasakan sensasi bermain judi slot yang tak terlupakan.  
    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa Di dunia perjudian online yang begitu kompetitif, mencari platform yang dapat memberikan kemenangan maksimal (Maxwin) dan hasil terbaik (Gacor) adalah prioritas bagi para penjudi yang cerdas. Dalam upaya ini, OLXTOTO telah muncul sebagai pemain kunci yang mengubah lanskap perjudian online dengan menawarkan pengalaman tanpa tandingan.     Sejak diluncurkan, OLXTOTO telah menjadi sorotan industri perjudian online. Dikenal sebagai "Platform Maxwin dan Gacor Terbesar Sepanjang Masa", OLXTOTO telah menarik perhatian pemain dari seluruh dunia dengan reputasinya yang solid dan kinerja yang luar biasa. Salah satu fitur utama yang membedakan OLXTOTO dari pesaingnya adalah komitmen mereka untuk memberikan pengalaman berjudi yang unik dan memuaskan. Dengan koleksi game yang luas dan beragam, termasuk togel, slot online, live casino, dan banyak lagi, OLXTOTO menawarkan sesuatu untuk semua orang. Dibangun dengan teknologi terkini dan didukung oleh tim ahli yang berdedikasi, platform ini memastikan bahwa setiap pengalaman berjudi di OLXTOTO tidak hanya menghibur, tetapi juga menguntungkan. Namun, keunggulan OLXTOTO tidak hanya terletak pada permainan yang mereka tawarkan. Mereka juga terkenal karena keamanan dan keadilan yang mereka berikan kepada para pemain mereka. Dengan sistem keamanan tingkat tinggi dan audit rutin yang dilakukan oleh otoritas regulasi independen, para pemain dapat yakin bahwa setiap putaran permainan di OLXTOTO adalah adil dan transparan. Tidak hanya itu, OLXTOTO juga dikenal karena layanan pelanggan yang luar biasa. Dengan tim dukungan yang ramah dan responsif, para pemain dapat yakin bahwa setiap pertanyaan atau masalah mereka akan ditangani dengan cepat dan efisien. Dengan semua fitur dan keunggulan yang ditawarkannya, tidak mengherankan bahwa OLXTOTO telah menjadi platform pilihan bagi para penjudi online yang mencari kemenangan maksimal dan hasil terbaik. Jadi, jika Anda ingin bergabung dengan jutaan pemain yang telah merasakan keajaiban OLXTOTO, jangan ragu untuk mendaftar dan mulai bermain hari ini!  
    • OLXTOTO adalah bandar slot yang terkenal dan terpercaya di Indonesia. Mereka menawarkan berbagai jenis permainan slot yang menarik dan menghibur. Dengan tampilan yang menarik dan grafis yang berkualitas tinggi, pemain akan merasa seperti berada di kasino sungguhan. OLXTOTO juga menyediakan layanan pelanggan yang ramah dan responsif, siap membantu pemain dengan segala pertanyaan atau masalah yang mereka hadapi. Daftar =  https://surkale.me/Olxtotodotcom1
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.