Large Fluid Tank

Large Fluid Tank

3M Downloads

Hiding unused tank recipes in JEI

Aspyro opened this issue · 8 comments

commented

In my pack, I use FluidTank and i needed to hide every tank from non vanilla material (lead, silver, copper, tin, bronze). It did work.
The same way i tried to hide every invisible tanks. I kinda worked but in the Gold Tank recipe, some of them still do appear (invisible_tank_iron, invisible_tank_silver, invisible_tank_bronze, invisible_tank_lead).
Same thing with the corresponding tanks used to craft the iron tank

I don't understand why.

There is the useful part in my script code (kubeJS) :

var FluidTankTanks = [
	'fluidtank:tank_copper',
	'fluidtank:tank_silver',
	'fluidtank:tank_tin',
	'fluidtank:tank_bronze',
	'fluidtank:tank_lead',
	'fluidtank:invisible_tank_copper',
	'fluidtank:invisible_tank_silver',
	'fluidtank:invisible_tank_tin',
	'fluidtank:invisible_tank_bronze',
	'fluidtank:invisible_tank_lead',
	'fluidtank:creative'
]

// Less useful, but here to show that eveything worked with all those arrays from other similar mods
var ArrayOfAllArrays = [
	IronFurnacesTierUpgrades,
	IronFurnacesUpgradedFurnaces,
	IronFurnacesRainbowRelatedItems,
	IronChestsChestUpgrades,
	IronChestsChests,
	IronShulkerBoxesShulkerUpgrades,
	IronShulkerBoxesShulkers,
	MetalBarrelsBarrelUpgrades,
	MetalBarrelsBarrels,
	FluidTankTanks
]

onEvent('recipes', event => {
  // Change recipes here

	ArrayOfAllArrays.forEach(detailledArray => {
		detailledArray.forEach(element => {
			event.remove({id: element})
			event.remove({input: element})
			event.remove({output: element})
		})
	});
});

I also did the same to hide all those items from the side panel in JEI, with this function in the appropriate file.
So all the fluid tanks I don't need are hidden from JEI, but they aren't in recipes where they would be used

onEvent('jei.hide.items', event => {
  // Hide items in JEI here
  // event.hide('minecraft:cobblestone')

  ArrayOfAllArrays.forEach(detailledArray => {
		detailledArray.forEach(element => {
			event.hide(element);
		})
	});
});
commented

What does the word “hide“ mean?

  1. Remove block completely
  2. Remove recipe in order not to be used in survival
  3. Hde from JEI, remaining the recipe available

I think you mean 2.
I don't know about KubeJS, but you can add “fluidtank:crafting_convert_invisible“ to remove all recipes for invisible tanks.

commented

I was thinking of a way to help that issue that would be :

  • add in the config file the possibility to not load invisible tanks
  • add in the config file the possibility to not load tanks from a non-vanilla material

While i'm at it, I was thinking of 2 other things you could add to the mod :

  • add in the config file the possibility to change the capacity of the tanks
  • add in the config file the possibility to add our own tanks
    Would you prefer that I write it in another issue ?
commented

Hiding means n°3
But I did 2 & 3.
I did use "fluidtank:crafting_convert_invisible" as you suggest, but I still see the invisible tanks as ingredients for the Gold and Iron tanks. It didn't work.
However, i'm sure there is no error in the script, because it works for everything else.

commented

I added some config options, "usableInvisibleInRecipe", "usableUnavailableTankInRecipe". Change both to false will hide tanks from recipe.

commented

You want to hide (or remove) invisible tanks from the recipe of normal tanks (in JEI and real crafting), right?
Not to load blocks is not allowed by forge, but I can make some tanks unusable as ingredient of high tier tank recipe.
These functions need code change, so I'll work in my dev environment.

Changing the capacity of tanks will result in strange rendering like this.

Actually, I have some ideas to solve this problem, but I need more time to implement and test it.

commented

Thanks for the updates, I'll try this out right now !
And thanks too for the information on the tanks capacity.

commented
commented

Nice changes, they do work perfectly !

But i'm curious, what means "easyRecipe" in the config file ? I tried changing it, but I don't know where it changed in the game Found it