Slimefun

Slimefun

3M Downloads

Disabling some Slimefun items shifted some multiblocks recipe

variananora opened this issue · 8 comments

commented

❗ Checklist

  • I am using the official english version of Slimefun and did not modify the jar.
  • I am using an up to date "DEV" (not "RC") version of Slimefun.
  • I am aware that issues related to Slimefun addons need to be reported on their bug trackers and not here.
  • I searched for similar open issues and could not find an existing bug report on this.

📍 Description

In this case I'll disable Stone Chunks from items.yml and try using Compressor

This also happened here: Slimefun-Addon-Community/ExoticGarden#210

I think this is because when registering recipe it didn't check for the disabled items.

recipes.add(new SlimefunItemStack(SlimefunItems.STONE_CHUNK, 4));
recipes.add(new ItemStack(Material.COBBLESTONE));
recipes.add(new ItemStack(Material.FLINT, 8));
recipes.add(new ItemStack(Material.COBBLESTONE));
recipes.add(new ItemStack(Material.COAL_BLOCK, 8));
recipes.add(new SlimefunItemStack(SlimefunItems.CARBON, 9));
recipes.add(new ItemStack(Material.CHARCOAL, 4));
recipes.add(new ItemStack(Material.COAL));

I haven't tried anything else but looking at things I think I can make this work one Ore Grinder and Ore Crusher too..

📑 Reproduction Steps

  1. Install Slimefun
  2. Disable Stone Chunks from items.yml
  3. Look at the guide, the recipe just got shifted
  4. Try using the compressor just using 1 coal
  5. It will output 8 coal

💡 Expected Behavior

The recipe should not be shifted.

📷 Screenshots / Videos

https://youtu.be/sgOPYilkLis

Side by side

Untitled

Normal Recipe

image

Shifted Recipe

image

📜 Server Log

No response

📂 /error-reports/ folder

No response

💻 Server Software

Paper

🎮 Minecraft Version

1.17.x

⭐ Slimefun version

> sf versions
[10:34:39 INFO]: This Server uses the following setup of Slimefun:
Paper git-Paper-279 (MC: 1.17.1)
Slimefun DEV - 974 (git 36c6d154)
Metrics-Module #28
Java 16

No Addons installed

🧭 Other plugins

No response

commented

Is this still an issue?

commented

Is this still an issue?

yes it is.

commented

Is this still an issue?

yes it is.

Do you know if it only happens with multiblocks or if it also happens with things like machines and the ancient altar

commented

just tested it and it only in multiblocks machine
it is not happening in ancient altar nor on machines.

Update: i think this is why it happens

if (item == null || !item.isDisabled()) {
recipes.add(new ItemStack[] { recipeItem });
}

This code checks for the item is disabled or not and added it to the recipe, thus making it shifted by 1 item.

This make sures the item is not able to be crafted or used as a crafting recipe.

image


Machines doesnt have this issue since it never check the item is disabled or not.

public void registerRecipe(int seconds, ItemStack[] input, ItemStack[] output) {
registerRecipe(new MachineRecipe(seconds, input, output));
}
public void registerRecipe(int seconds, ItemStack input, ItemStack output) {
registerRecipe(new MachineRecipe(seconds, new ItemStack[] { input }, new ItemStack[] { output }));
}

But because it never checks the item is disabled or not, it still works inside the machine if you still have the items.
(Not sure it will fit inside this issue or should be seperated to another issue.)

image


nor do ancient altar

image

commented

Alright thank you, think I know what is causing it now

commented

Alright sorry for the delay but think I made a fix for this, @variananora any chance you could test a jar? I'm not home so I can't test it and I won't be home for a couple days

commented

@variananora any chance you could test a jar?

yeah sure just ping me at discord for this things

commented

@variananora any chance you could test a jar?

yeah sure just ping me at discord for this things

Got it 👍