thedarkcolour / ExDeorum

Port of the original Ex Nihilo to 1.20+.
GNU General Public License v3.0
7 stars 3 forks source link

recommendation #52

Closed azezzed closed 9 months ago

azezzed commented 9 months ago

Hello author, I am currently working on the extension module for exdeorum: exdeorum_ex. I have already made many compression tools, blocks, and items. I hope the author can change the recipe of the crock to be like a hammer that can be added by themselves. There is also an acceleration formula similar to adding a magma crucible. Finally, I am a Uyghur from Xinjiang, China. I have translated these requirements from Chinese to English, and there may be many errors. I hope the author can understand my meaning. Thank you. Once the module is ready, I will send it out.

azezzed commented 9 months ago

-------原文------- 您好作者,我正在做exdeorum的扩展模组:exdeorum_ex。 已经做了很多压缩工具和方块,还有物品,希望作者能把crook的配方改成跟锤子一样可自己添加。还有跟类似加上岩浆坩埚的加速配方。 最后,我是来自中国新疆的维吾尔族,这些要求我都是汉文翻译成英文的,可能会有很多错误,希望作者能看明白我的意思。谢谢~模组做好了之后我会发出去的。

azezzed commented 9 months ago

I really like the 1.19.2 version of the "make out of nothing" recipe. Its code is written neatly and can save a lot of space. If the author has considered it, they can refer to the synthetic formula in version 1.19.2. As follows: ---原文--- 我真的很喜欢1.19.2版本的无中生有配方。它的代码写的很整齐而能节省很多空间。如果作者有考虑,可以参照1.19.2版本的合成配方。如下:

{"type":"exnihilosequentia:sieve", "input":{"item":"minecraft:acacia_leaves"}, "result":{"item":"minecraft:acacia_sapling"}, "rolls":[ {"chance":0.05,"mesh":"string"}, {"chance":0.1,"mesh":"flint"}, {"chance":0.15,"mesh":"iron"}, {"chance":0.2,"mesh":"diamond"}]}

azezzed commented 9 months ago

This can really save a lot of time

thedarkcolour commented 9 months ago

希望作者能把crook的配方改成跟锤子一样可自己添加。还有跟类似加上岩浆坩埚的加速配方。

If you wish to make your Compressed Crook item usable on leaves for the crook recipes, you can add your crook to the exdeorum:crooks tag and it will be detected, similar to hammers. In the next update of Ex Deorum, I have made Crook recipes customizable. For example, you could add a Crook recipe that gives a slight chance of dropping a silkworm when breaking a Tall Grass block.

我真的很喜欢1.19.2版本的无中生有配方。它的代码写的很整齐而能节省很多空间。如果作者有考虑,可以参照1.19.2版本的合成配方

I can add some code to interpret the 1.19 recipes into Ex Deorum recipes. Personally, this change does not affect me because I use Data Generation to add recipes rather than JSON. If you would like to do the same or create a script to do it for your mod, you can see what I've done here: theadarkcolour/exdeorum/data/recipe/SieveRecipes.java

Let me know if you want me to include an API package to avoid breaking changes in your mod.

azezzed commented 9 months ago

First of all, thank you for your answer. I'm sorry to say that I don't know the logic of the Java language, but my research on this "ex deorum" series of modules can be said to be very meticulous. I personally have many restrictions on accessing GitHub to leave messages with you. What I want to say is that if the author can solve the above problems and update the module, it would be great, so that I can use this module to expand it. ----原文---- 首先,谢谢您的回答,很不好意思的说,我不会java语言的逻辑,但是我对这个《ex deorum》系列模组的研究可以说是很仔细。我个人访问GitHub也是通过很多限制才能跟您留言,我这边想说的就是,如果作者能把以上的问题解决以后把模组更新一下就太好了,那样我可以利用这个模组来做它的扩展。

azezzed commented 9 months ago

I really want to know how you made these codes generate a separate file: //Dirt ->String mesh ForMesh (writer, ingredient (Items. DIRT), EIitems STRING-MESH, (addDrop, addTagDrop, addConditionalDrop) ->{ AddDrop. accept (EIitems. STONE-PEBBLE. get(), binary (7, 0.6f)); AddDrop. accept (Items. FLINT, chance (0.25f)); AddDrop. accept (Items. WHIAT-SEEDS, chance (0.125f)); AddDrop. accept (Items. MELON-SEEDS, chance (0.1f)); AddDrop. accept (Items. PUMPKIN_SEEDS, chance (0.1f)); AddDrop. accept (Items. BEETROOT.SEEDS, chance (0.1f)); AddDrop. accept (Items. POTATO, chance (0.1f)); AddDrop. accept (Items. CARROT, chance (0.1f)); AddDrop. accept (EIitems. GRASS-SEEDS. get(), chance (0.1f)); AddDrop. accept (EIitems. MYCELIUM_SPORES. get(), chance (0.03f)); AddDrop. accept (Items. SUGAR-CANE, chance (0.1f)); AddDrop. accept (Items. POISONOUS-POTATO, chance (0.05f)); AddDrop. accept (Items. BAMBOO, chance (0.04f)); }); The code is written like this, but each line of code in the module file generates a file, which is really cool. I really want to learn~I am really tired of writing the sieve formula for compressed blocks one by one. ----原文---- 我很想知道您是怎么让这些代码能单独生成一个文件的: --这里展现了代码部分-- 代码是这样写了,但是在模组文件中每一行代码生成了一个文件,真的太酷了,很想学~我一个一个写压缩方块的筛子配方真的很累。

thedarkcolour commented 9 months ago

我个人访问GitHub也是通过很多限制才能跟您留言,我这边想说的就是,如果作者能把以上的问题解决以后把模组更新一下就太好了,那样我可以利用这个模组来做它的扩展。

Is there another way I can contact you besides through GitHub?

代码是这样写了,但是在模组文件中每一行代码生成了一个文件,真的太酷了,很想学我一个一个写压缩方块的筛子配方真的很累。

This code utilizes Java 8's Lambda functions. For a Java program, this code is very convoluted, but I will try to do my best to explain. Here is the forMesh method, which is where you pass in that big lambda where all the recipes get added. Here is the code for that method:

private static void forMesh(Consumer<FinishedRecipe> writer, Ingredient block, RegistryObject<? extends Item> mesh, ForMeshContext addDrops) {
    var folder = mesh.getId().getPath().replace("_mesh", "/");
    var basePath = path(block.getItems()[0].getItem()) + "/" + folder;

    addDrops.accept(
            (result, resultAmount) -> sieveRecipe(writer, basePath + path(result), block, mesh, result, resultAmount),
            (resultTag, resultAmount) -> sieveRecipeTag(writer, basePath + resultTag.location().getPath().concat("_tag"), block, mesh, resultTag, resultAmount),
            ((result, resultAmount, condition) -> sieveConditional(writer, basePath + result.map(MKRecipeProvider::path, tag -> tag.location().getPath().concat("_tag")), block, mesh, result, resultAmount, condition))
    );
}

The recipes are added in the ForMeshContext lambda, which is basically a wrapper around the sieveRecipe, sieveRecipeTag, and sieveConditional methods which, by themselves, create individual .json recipe files. forMesh fills in a bunch of the information that all recipes within this mesh have in common. So when you call forMesh and pass in a lambda that looks like this:

forMesh(writer, ingredient(Items.MOSS_BLOCK), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> {
    addDrop.accept(Items.SWEET_BERRIES, chance(0.03f));
    addDrop.accept(Items.FLOWERING_AZALEA, chance(0.03f));
    addDrop.accept(Items.GLOW_LICHEN, chance(0.04f));
    addDrop.accept(Items.LILY_PAD, chance(0.04f));
});

It is equivalent to this code:

sieveRecipe(writer, "moss_block/diamond/sweet_berries", ingredient(Items.MOSS_BLOCK), EItems.FLINT_MESH, Items.SWEET_BERRIES, chance(0.03f));
sieveRecipe(writer, "moss_block/diamond/flowering_azalea", ingredient(Items.MOSS_BLOCK), EItems.FLINT_MESH, Items.FLOWERING_AZALEA, chance(0.03f));
// ...

The trickiest part of the code here is the use of Java Lambda expressions. When you call forMesh, you pass a "lambda" which is basically an anonymous method, or a piece of code that gets stored in a variable. This lambda has three parameters, addDrop, addTagDrop, and addConditionalDrop. What makes this confusing for the reader is that these parameters are lambdas too. If you go back to the code the forMesh method, you'll see that these lambdas are (result, resultAmount) -> sieveRecipe(writer, basePath + path(result), block, mesh, result, resultAmount), (resultTag, resultAmount) -> sieveRecipeTag(writer, basePath + resultTag.location().getPath().concat("_tag"), block, mesh, resultTag, resultAmount), and ((result, resultAmount, condition) -> sieveConditional(writer, basePath + result.map(MKRecipeProvider::path, tag -> tag.location().getPath().concat("_tag")), block, mesh, result, resultAmount, condition)), respectively. But forMesh runs the lambda you supply once, defining those three parameter lambdas, and you can invoke them by calling accept on them with the necessary parameters. You can consider the three lambda parameters as macros for the sieveRecipe, sieveRecipeTag, etc. methods. I'm sure this could be achieved in a simpler way without using lambdas, but I ended up writing it this way.

azezzed commented 9 months ago

---translate--- Hello author, if you could use WeChat or QQ on your end, that would be great. Because we have many restrictions here, we are unable to use many communication tools normally. Thank you very much for providing me with such good code. Although I can't understand it, it looks very useful. The extension modules I make are all made by MCR. The formulas were written manually, so I encountered a lot of trouble in many places. I can provide you with my mods and current processes. If you have time, I can share my ideas with you. Many of my ideas cannot be implemented because I don't know the logic of Java. If there is no other way to contact someone by phone, we can choose to contact them via email. This will also be my first time using email to contact someone, hahaha~ ---原文--- 您好作者,如果您这边能用《微信》或者《QQ》的话就好了。因为,我们这边有特别多的限制,无法能正常使用很多交流工具。非常感谢您给我提供了那么好的代码,虽然我看不懂,但是看起来很有用。我做的扩展模组都是MCR做的。配方那些是手动写的,所以很多地方我都遇到了很多麻烦,我可以给您提供我的模组和现在的进程,如果您有时间的话,我可以把自己的想法给你说,我很多想法正因为不知道java的逻辑而实现不了。如果没有其他办法联系电话,我们可以选择邮件联系,这也将会是我第一次用邮件跟一个人联系,哈哈哈~

------------------ 原始邮件 ------------------ 发件人: "thedarkcolour/ExDeorum" @.>; 发送时间: 2024年2月11日(星期天) 中午12:16 @.>; @.**@.>; 主题: Re: [thedarkcolour/ExDeorum] recommendation (Issue #52)

我个人访问GitHub也是通过很多限制才能跟您留言,我这边想说的就是,如果作者能把以上的问题解决以后把模组更新一下就太好了,那样我可以利用这个模组来做它的扩展。 Is there another way I can contact you besides through GitHub? 代码是这样写了,但是在模组文件中每一行代码生成了一个文件,真的太酷了,很想学我一个一个写压缩方块的筛子配方真的很累。 This code utilizes Java 8's Lambda functions. For a Java program, this code is very convoluted, but I will try to do my best to explain. Here is the forMesh method, which is where you pass in that big lambda where all the recipes get added. Here is the code for that method: private static void forMesh(Consumer<FinishedRecipe> writer, Ingredient block, RegistryObject<? extends Item> mesh, ForMeshContext addDrops) { var folder = mesh.getId().getPath().replace("_mesh", "/"); var basePath = path(block.getItems()[0].getItem()) + "/" + folder;addDrops.accept( (result, resultAmount) -> sieveRecipe(writer, basePath + path(result), block, mesh, result, resultAmount), (resultTag, resultAmount) -> sieveRecipeTag(writer, basePath + resultTag.location().getPath().concat("_tag"), block, mesh, resultTag, resultAmount), ((result, resultAmount, condition) -> sieveConditional(writer, basePath + result.map(MKRecipeProvider::path, tag -> tag.location().getPath().concat("_tag")), block, mesh, result, resultAmount, condition)) ); }

The recipes are added in the ForMeshContext lambda, which is basically a wrapper around the sieveRecipe, sieveRecipeTag, and sieveConditional methods which, by themselves, create individual .json recipe files. forMesh fills in a bunch of the information that all recipes within this mesh have in common. So when you call forMesh and pass in a lambda that looks like this: forMesh(writer, ingredient(Items.MOSS_BLOCK), EItems.FLINT_MESH, (addDrop, addTagDrop, addConditionalDrop) -> { addDrop.accept(Items.SWEET_BERRIES, chance(0.03f)); addDrop.accept(Items.FLOWERING_AZALEA, chance(0.03f)); addDrop.accept(Items.GLOW_LICHEN, chance(0.04f)); addDrop.accept(Items.LILY_PAD, chance(0.04f)); });

It is equivalent to this code: sieveRecipe(writer, "moss_block/diamond/sweet_berries", ingredient(Items.MOSS_BLOCK), EItems.FLINT_MESH, Items.SWEET_BERRIES, chance(0.03f)); sieveRecipe(writer, "moss_block/diamond/flowering_azalea", ingredient(Items.MOSS_BLOCK), EItems.FLINT_MESH, Items.FLOWERING_AZALEA, chance(0.03f)); // ...

The trickiest part of the code here is the use of Java Lambda expressions. When you call forMesh, you pass a "lambda" which is basically an anonymous method, or a piece of code that gets stored in a variable. This lambda has three parameters, addDrop, addTagDrop, and addConditionalDrop. What makes this confusing for the reader is that these parameters are lambdas too. If you go back to the code the forMesh method, you'll see that these lambdas are (result, resultAmount) -> sieveRecipe(writer, basePath + path(result), block, mesh, result, resultAmount), (resultTag, resultAmount) -> sieveRecipeTag(writer, basePath + resultTag.location().getPath().concat("_tag"), block, mesh, resultTag, resultAmount), and ((result, resultAmount, condition) -> sieveConditional(writer, basePath + result.map(MKRecipeProvider::path, tag -> tag.location().getPath().concat("_tag")), block, mesh, result, resultAmount, condition)), respectively. But forMesh runs the lambda you supply once, defining those three parameter lambdas, and you can invoke them by calling accept on them with the necessary parameters. You can consider the three lambda parameters as macros for the sieveRecipe, sieveRecipeTag, etc. methods. I'm sure this could be achieved in a simpler way without using lambdas, but I ended up writing it this way. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

thedarkcolour commented 9 months ago

Do you have Discord?

azezzed commented 9 months ago

sorry        no...

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2024年2月11日(星期天) 下午3:31 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [thedarkcolour/ExDeorum] recommendation (Issue #52)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

azezzed commented 9 months ago

I can't use Discord, I'm sorry. I tried to send you the project file for the extension module, but I'm not sure if you can use WeChat or QQ on your end. If only you have it 我没办法用discord,对不起。我想办法发给你那个扩展模组的工程文件,但是不知道你那边能不能用微信或者QQ,如果你有就好了...

azezzed commented 9 months ago

https://github.com/azezzed/exdeorum_ex

thedarkcolour commented 9 months ago

You should not upload ZIP files of your projects as GitHub projects. It should just show the file layout instead of being contained in a ZIP file. I apologize, but I cannot endorse an MCreator project. I'm planning on making my own compressed blocks project soon, so stay tuned.

thedarkcolour commented 8 months ago

I wrote a Python script to translate Ex Nihilo Sequentia recipes to Ex Deorum recipes: you can find it here