Jump to content

Recommended Posts

Posted

You would find how that custom crafting table stores it's recipe list, and then add to it....

Cant really help much on such a vague question.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

ok i have the recipe list, the manager ,inventory,inv result i want to make it so

that when i put a certain recipe in the compactor it shows but all i have at the moment is a blank useless crafting gui inside the compactor what i want to know is how would i register the recipe's to the compactor like make the crafting result display when you put a defined recipe in

Posted

Ah, you should look into how minecraft does it, go look at the Crafting table's Container class.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

ok i have had a look and changed it to what i think is correct but it gives an error in the Compactor manager this is my code

 

package net.minecraft.src;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

public class CompactorManager
{
    /** The static instance of this class */
    private static final CompactorManager instance = new CompactorManager();

    /** A list of all the recipes added */
    private List recipes = new ArrayList();

    /**
     * Returns the static instance of this class
     */
    public static final CompactorManager getInstance()
    {
        return instance;
    }

    private CompactorManager()
    {
        this.addRecipe(new ItemStack(mod_Blastcraft.blastwall), new Object[]{"@#@","@#@","@#@",Character.valueOf('#'),mod_Blastcraft.rebarmesh,Character.valueOf('@'),Block.brick});       
        System.out.println(this.recipes.size() + " recipes");
    }

    /**
     * Adds a recipe. See spreadsheet on first page for details.
     */
    void addRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj)
    {
        String var3 = "";
        int var4 = 0;
        int var5 = 0;
        int var6 = 0;

        if (par2ArrayOfObj[var4] instanceof String[])
        {
            String[] var7 = (String[])((String[])par2ArrayOfObj[var4++]);

            for (int var8 = 0; var8 < var7.length; ++var8)
            {
                String var9 = var7[var8];
                ++var6;
                var5 = var9.length();
                var3 = var3 + var9;
            }
        }
        else
        {
            while (par2ArrayOfObj[var4] instanceof String)
            {
                String var11 = (String)par2ArrayOfObj[var4++];
                ++var6;
                var5 = var11.length();
                var3 = var3 + var11;
            }
        }

        HashMap var12;

        for (var12 = new HashMap(); var4 < par2ArrayOfObj.length; var4 += 2)
        {
            Character var13 = (Character)par2ArrayOfObj[var4];
            ItemStack var14 = null;

            if (par2ArrayOfObj[var4 + 1] instanceof Item)
            {
                var14 = new ItemStack((Item)par2ArrayOfObj[var4 + 1]);
            }
            else if (par2ArrayOfObj[var4 + 1] instanceof Block)
            {
                var14 = new ItemStack((Block)par2ArrayOfObj[var4 + 1], 1, -1);
            }
            else if (par2ArrayOfObj[var4 + 1] instanceof ItemStack)
            {
                var14 = (ItemStack)par2ArrayOfObj[var4 + 1];
            }

            var12.put(var13, var14);
        }

        ItemStack[] var15 = new ItemStack[var5 * var6];

        for (int var16 = 0; var16 < var5 * var6; ++var16)
        {
            char var10 = var3.charAt(var16);

            if (var12.containsKey(Character.valueOf(var10)))
            {
                var15[var16] = ((ItemStack)var12.get(Character.valueOf(var10))).copy();
            }
            else
            {
                var15[var16] = null;
            }
        }

        this.recipes.add(new ShapedRecipes(var5, var6, var15, par1ItemStack));
    }

    public ItemStack findMatchingRecipe(Inventorycompactor par1InventoryCrafting)
    {
        int var2 = 0;
        ItemStack var3 = null;
        ItemStack var4 = null;
        int var5;

        for (var5 = 0; var5 < par1InventoryCrafting.getSizeInventory(); ++var5)
        {
            ItemStack var6 = par1InventoryCrafting.getStackInSlot(var5);

            if (var6 != null)
            {
                if (var2 == 0)
                {
                    var3 = var6;
                }

                if (var2 == 1)
                {
                    var4 = var6;
                }

                ++var2;
            }
        }

        if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isRepairable())
        {
            Item var11 = Item.itemsList[var3.itemID];
            int var10 = var11.getMaxDamage() - var3.getItemDamageForDisplay();
            int var7 = var11.getMaxDamage() - var4.getItemDamageForDisplay();
            int var8 = var10 + var7 + var11.getMaxDamage() * 10 / 100;
            int var9 = var11.getMaxDamage() - var8;

            if (var9 < 0)
            {
                var9 = 0;
            }

            return new ItemStack(var3.itemID, 1, var9);
        }
        else
        {
            for (var5 = 0; var5 < this.recipes.size(); ++var5)
            {
                IRecipe var12 = (IRecipe)this.recipes.get(var5);

                if (var12.matches(par1InventoryCrafting))
                {
                    return var12.getCraftingResult(par1InventoryCrafting);
                }
            }

            return null;
        }
    }

    /**
     * returns the List<> of all recipes
     */
    public List getRecipeList()
    {
        return this.recipes;
    }
}

 

it give the error at this section of code

                if (var12.matches(par1InventoryCrafting))
                {
                    return var12.getCraftingResult(par1InventoryCrafting);
                }

do i need to make my own IRecipe?

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

    • I just tried installing Forge version 1.21.3, and tried launching it with no mods installed. It loads, and immediately crashes while "loading bootstrap resourses." Does anyone know a fix for this? My Java is up to date, as well as my graphics drivers. Here's a snip right before it crashes: https://imgur.com/a/elLujPj
    • I know this is a forge only place, but just to be clear, my error is in Fabric I was actually super frustrated while trying to fix this, like this mod does work when I play it by launching it in minecraft, but when I was trying to install it onto the server it just kept crashing so I decided to delete every mod I've got but kept the bewitchment mod and the necessary mod it needs to function and I tried to run the server... But it somehow still crashed, and the thing is that I really do want the bewitchment mod to be in the SMP so it'll be SUPER helpful if anyone can figure out on how to fix this: It didn't give me any "crash-reports" so I'll be sending the logs and what the console said: Console: [18:51:46] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/home/container/libraries/net/fabricmc/sponge-mixin/0.13.3+mixin.0.8.5/sponge-mixin-0.13.3+mixin.0.8.5.jar Service=Knot/Fabric Env=SERVER [18:51:46] [main/WARN]: Error loading class: io/github/apace100/origins/power/PreventItemUsePower (java.lang.ClassNotFoundException: io/github/apace100/origins/power/PreventItemUsePower) [18:51:46] [main/WARN]: @Mixin target io.github.apace100.origins.power.PreventItemUsePower was not found bewitchment.mixins.json:integration.origins.PreventItemUsePowerMixin from mod bewitchment [18:51:47] [main/INFO]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.5). [18:51:52] [main/FATAL]: Failed to start the minecraft server java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'bewitchment'! at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:63) ~[fabric-loader-0.15.11.jar:?] at net.minecraft.server.Main.main(Main.java:92) [server-intermediary.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.15.11.jar:?] at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69) [server.jar:1.0.1] Caused by: java.lang.NoSuchFieldError: TEXTURE at moriyashiine.bewitchment.common.item.SpecterBangleItem.<clinit>(SpecterBangleItem.java:28) ~[bewitchment-1.16.5-18.jar:?] at moriyashiine.bewitchment.common.registry.BWObjects.<clinit>(BWObjects.java:272) ~[bewitchment-1.16.5-18.jar:?] at moriyashiine.bewitchment.common.Bewitchment.onInitialize(Bewitchment.java:221) ~[bewitchment-1.16.5-18.jar:?] at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384) ~[fabric-loader-0.15.11.jar:?] ... 7 more Logs: https://mclo.gs/wSsqMfn
    • I know this is a forge only place, but just so you know my error is in Fabric I was actually super frustrated while trying to fix this, like this mod does work when I play it by launching it in minecraft, but when I was trying to install it onto the server it just kept crashing so I decided to delete every mod I've got but kept the bewitchment mod and the necessary mod it needs to function and I tried to run the server... But it somehow still crashed, and the thing is that I really do want the bewitchment mod to be in the SMP so it'll be SUPER helpful if anyone can figure out on how to fix this: It didn't give me any "crash-reports" so I'll be sending the logs and what the console said: Console: [18:51:46] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/home/container/libraries/net/fabricmc/sponge-mixin/0.13.3+mixin.0.8.5/sponge-mixin-0.13.3+mixin.0.8.5.jar Service=Knot/Fabric Env=SERVER [18:51:46] [main/WARN]: Error loading class: io/github/apace100/origins/power/PreventItemUsePower (java.lang.ClassNotFoundException: io/github/apace100/origins/power/PreventItemUsePower) [18:51:46] [main/WARN]: @Mixin target io.github.apace100.origins.power.PreventItemUsePower was not found bewitchment.mixins.json:integration.origins.PreventItemUsePowerMixin from mod bewitchment [18:51:47] [main/INFO]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.5). [18:51:52] [main/FATAL]: Failed to start the minecraft server java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'bewitchment'! at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:63) ~[fabric-loader-0.15.11.jar:?] at net.minecraft.server.Main.main(Main.java:92) [server-intermediary.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.15.11.jar:?] at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69) [server.jar:1.0.1] Caused by: java.lang.NoSuchFieldError: TEXTURE at moriyashiine.bewitchment.common.item.SpecterBangleItem.<clinit>(SpecterBangleItem.java:28) ~[bewitchment-1.16.5-18.jar:?] at moriyashiine.bewitchment.common.registry.BWObjects.<clinit>(BWObjects.java:272) ~[bewitchment-1.16.5-18.jar:?] at moriyashiine.bewitchment.common.Bewitchment.onInitialize(Bewitchment.java:221) ~[bewitchment-1.16.5-18.jar:?] at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384) ~[fabric-loader-0.15.11.jar:?] ... 7 more Logs: https://mclo.gs/wSsqMfn
    • Open the Task Manager and check the Performance Tab At GPU the GPU is mentioned above the Graph
    • how? and how do i find what graphics card i have
  • Topics

×
×
  • Create New...

Important Information

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