• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I am working on a mod that adds a crafting station with five input slots and one output slot. I want to implement a new crafting type so that I can create shapeless recipes for use with this block, but that cannot be crafted in any other table.   I found this example that was shared by someone on a different thread that helped me get started setting up the IRecipe and Serializer. Im not totally sure, but it seems to me like this recipe type takes a single input and produces output from looking at the matches() function, but I could be understanding it wrong. My block also will have no ticks/processing time so I removed that.    Here is my recipe class so far public class BdoCookingRecipe implements IRecipe<RecipeWrapper> { private final ResourceLocation id; private final String group; private final NBTIngredient original; private final ItemStack result; public BdoCookingRecipe(ResourceLocation id, String group, NBTIngredient original, ItemStack result) { this.id = id; this.group = group; this.original = original; this.result = result; } @Override public boolean matches(RecipeWrapper inv, World worldIn) { return this.original.test(inv.getStackInSlot(0)); } @Override public ItemStack getCraftingResult(RecipeWrapper inv) { return this.result.copy(); } @Override public boolean canFit(int width, int height) { return true; } @Override public ItemStack getRecipeOutput() { return this.result; } @Override public ResourceLocation getId() { return this.id; } @Override public String getGroup() { return this.group; } @Override public NonNullList<Ingredient> getIngredients() { return NonNullList.withSize(1, this.original); } @Override public NonNullList<ItemStack> getRemainingItems(RecipeWrapper inv) { return NonNullList.create(); } @Override public ItemStack getIcon() { return new ItemStack(RegistryHandler.BASIC_COOKING_UTENSIL_BLOCK.get()); } @Override public IRecipeSerializer<?> getSerializer() { return ModRecipes.BDOCOOKING.get(); } @Override public IRecipeType<?> getType() { return ModRecipes.Type.BDOCOOKING; } public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<BdoCookingRecipe> { @Override public BdoCookingRecipe read(ResourceLocation recipeId, JsonObject json) { String group = JSONUtils.getString(json, "group", ""); NBTIngredient ingredient = NBTIngredient.Serializer.INSTANCE.parse(JSONUtils.getJsonObject(json, "ingredient")); ItemStack result = CraftingHelper.getItemStack(JSONUtils.getJsonObject(json, "result"), true); return new BdoCookingRecipe(recipeId, group, ingredient, result); } @Override public BdoCookingRecipe read(ResourceLocation recipeId, PacketBuffer buffer) { String group = buffer.readString(32767); NBTIngredient ingredient = NBTIngredient.Serializer.INSTANCE.parse(buffer); ItemStack result = buffer.readItemStack(); return new BdoCookingRecipe(recipeId, group, ingredient, result); } @Override public void write(PacketBuffer buffer, BdoCookingRecipe recipe) { buffer.writeString(recipe.group); recipe.original.write(buffer); buffer.writeItemStack(recipe.result); } } }   And the serializer public class ModRecipes { public static class Type { public static final IRecipeType<BdoCookingRecipe> BDOCOOKING = IRecipeType.register(BdoCooking.MOD_ID + ":bdocooking"); } public static final DeferredRegister<IRecipeSerializer<?>> RECIPE_SERIALIZERS = new DeferredRegister<>(ForgeRegistries.RECIPE_SERIALIZERS, BdoCooking.MOD_ID); public static final RegistryObject<IRecipeSerializer<BdoCookingRecipe>> BDOCOOKING = RECIPE_SERIALIZERS.register("bdocooking", () -> (new BdoCookingRecipe.Serializer())); }   What changes do I need to make to ensure that this recipe will be shapeless and support 5 inputs?   Github: https://github.com/AliceProxy/CookingMod/tree/master/src/main/java/com/proxyalice/bdocookingmod   Thanks for any help and suggestions.
    • Ok, so its impossible. Thanks.
    • I found the log for when i loaded it up  [07Aug2020 13:15:24.721] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, Davron_29, --version, 1.16.1-forge-32.0.106, --gameDir, C:\Users\David HARRIS\AppData\Roaming\.minecraft, --assetsDir, C:\Users\David HARRIS\AppData\Roaming\.minecraft\assets, --assetIndex, 1.16, --uuid, 5e2ede46314d42f89ddaf1ff07886a17, --accessToken, ????????, --userType, mojang, --versionType, release, --launchTarget, fmlclient, --fml.forgeVersion, 32.0.106, --fml.mcVersion, 1.16.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20200625.160719] [07Aug2020 13:15:24.735] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 6.1.1+74+master.966c698 starting: java version 1.8.0_51 by Oracle Corporation [07Aug2020 13:15:26.394] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [07Aug2020 13:15:26.568] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8 Source=file:/C:/Users/David%20HARRIS/AppData/Roaming/.minecraft/libraries/org/spongepowered/mixin/0.8/mixin-0.8.jar Service=ModLauncher Env=CLIENT [07Aug2020 13:15:26.713] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: com.electronwill.nightconfig.core.io.ParsingException: Not enough data available [07Aug2020 13:15:26.714] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.io.ParsingException.notEnoughData(ParsingException.java:22) [07Aug2020 13:15:26.715] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.io.ReaderInput.directReadChar(ReaderInput.java:36) [07Aug2020 13:15:26.716] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.io.AbstractInput.readChar(AbstractInput.java:49) [07Aug2020 13:15:26.717] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.io.AbstractInput.readCharsUntil(AbstractInput.java:123) [07Aug2020 13:15:26.718] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.toml.TableParser.parseKey(TableParser.java:166) [07Aug2020 13:15:26.720] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.toml.TableParser.parseDottedKey(TableParser.java:145) [07Aug2020 13:15:26.720] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:55) [07Aug2020 13:15:26.721] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:44) [07Aug2020 13:15:26.722] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:37) [07Aug2020 13:15:26.723] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:113) [07Aug2020 13:15:26.724] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:219) [07Aug2020 13:15:26.725] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:202) [07Aug2020 13:15:26.726] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.load(WriteSyncFileConfig.java:73) [07Aug2020 13:15:26.727] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.file.AutoreloadFileConfig.load(AutoreloadFileConfig.java:41) [07Aug2020 13:15:26.727] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.load(AutosaveCommentedFileConfig.java:85) [07Aug2020 13:15:26.728] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.loading.FMLConfig.loadFrom(FMLConfig.java:57) [07Aug2020 13:15:26.729] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.loading.FMLConfig.load(FMLConfig.java:69) [07Aug2020 13:15:26.730] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.loading.FMLServiceProvider.initialize(FMLServiceProvider.java:81) [07Aug2020 13:15:26.731] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServiceDecorator.onInitialize(TransformationServiceDecorator.java:68) [07Aug2020 13:15:26.732] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServicesHandler.lambda$initialiseTransformationServices$7(TransformationServicesHandler.java:107) [07Aug2020 13:15:26.732] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServicesHandler$$Lambda$85/1313916817.accept(Unknown Source) [07Aug2020 13:15:26.733] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at java.util.HashMap$Values.forEach(HashMap.java:972) [07Aug2020 13:15:26.734] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServicesHandler.initialiseTransformationServices(TransformationServicesHandler.java:107) [07Aug2020 13:15:26.735] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:59) [07Aug2020 13:15:26.736] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.Launcher.run(Launcher.java:75) [07Aug2020 13:15:26.737] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)  
    • I’m not sure what you mean be client side time but there’s a pr on github trying to implement client side commands register event, you might want to have a look at it.
    • How could I create a client side command in 1.16? My idea for this was so I could add commands like /day or /night to set the client side time. Thanks. EDIT: Also, I would like to say that I am new to forge and just set it up today. I have had past experiences with spigot, but I see that it is nothing like forge.
  • Topics

  • Who's Online (See full list)