Jump to content

Torq

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by Torq

  1. Perhaps the net.minecraft.client.renderer.FirstPersonRenderer class is responsible for this. Line 260, renderItemInFirstPerson (-) method. Line 330 Case: BOW How can I replace the renderer with my own? Is there a corresponding event in which I could replace the renderer? What do i need to do? I am still not sure if this is what I am looking for. But I would like to try to duplicate this case for my longbow and see the result. But I do not know how to make the game use my renderer.
  2. I just copied the source code, imported the gradle project, and ran tasks for all IDEs. I have IntellijIDEA, Eclipse, VScode working with vanilla source. IMPORTANT! You need to wait until IDE downloads and prepares all the files. gradle tasks --all By the way, I recommend specifying "org.gradle.java.home = ? / Program Files / Java / jdk1.8.0_241" in gradle.properties
  3. I'm trying to add a long bow, as in the better archery 1.6.3 (last) mod. The versions are very different, which greatly complicates the study of its source code. I added my class ModBowItem inheriting from ShootableItem. It almost completely repeats Vanilla BowItem, but allows you to adjust the damage, arrow speed and pull time. The item has a model, texture (temporarily from the original mod). It is necessary: add a camera zoom when aiming, like vanilla bow; repair enchantments. What I would like from you: tell me which classes are responsible for these functions or better attach the examples, because I could not find; if I'm doing something wrong (anywhere in the mod), tell me about it. I'm tired of decompiling mods for clues ... I cannot inherit from BowItem, because in it the method of calculating velocity is static and I can’t access the properties of the class in it. REPOSITORY
  4. I'm not an expert, but maybe this is done using the states of blocks and models? The texture is indicated in the model, and when the state changes (when clicked or as you want) the model will change. If I'm wrong, correct me.
  5. I have written the same thing several times. I have vanilla block classes. I want to make my object for each type (in order to study each type). I want to assign them harvestLevel and toolType, and they are private! I was told to override getHarvestLevel() and getToolType(). I have to duplicate all classes from net.minecraft.block (like ModBlock extend Block, ModBlockGlowstone extend BlockGlowstone, ModBlockClay extend BlockClay and all others) and override them with getHarvestLevel () and getToolType (). If I want (and I WANT) to use these classes to create all the objects and not to create 100 classes of blocks for each case (harvestLevel = 1,2,3,4 and toolType = axe, pickaxe and other), I will have to endure my classes in the library, override some of the methods and private them (which are deprecated), make normal constructors taking into account the new harvestLevel and toolType and can add some methods (for example setHarvestLevel() and setToolType() ) for the convenience of using these classes. So, I have to do this or have an option where I can normally set harvestLevel and toolType without overriding methods. Or maybe all the same the Forge team plans to make this mechanism normal for use? upd* Why do I want to inherit every class? What would be compatibility with vanilla types. Therefore, I wrote: I repeat the question. Should I make a library for modders (for myself), so that I would have my overridden classes that are fully compatible with net.minecraft.block, but with normal class constructors and private methods (which are depricated and will be deleted)? Although it will be necessary to look, they are not used anywhere other than the class itself and there already to think what to do with them. What I want to do is normal, or not? Does this make sense or will the Forge team add it? Or maybe there is already something similar? Or it makes no sense, because it will not work or will the update come out and everything will break? Or would it be better to inherit from "extends net.minecraftforge.registries.ForgeRegistryEntry <Block> implements IItemProvider, net.minecraftforge.common.extensions.IForgeBlock" and rewrite all other types, but without inheriting the garbage code? But I am afraid to imagine what will come of it and whether the game mechanisms will work normally. Forge type registries are Block, so this option is most likely not suitable.
  6. Do I have to do this for every class in net.minecraft.block?
  7. I'm writing that I should inherit all the classes in net.minecraft.block and override each of them getHarvestLevel () and getHarvestTool (). And I will have a package with the same classes, but with overridden methods. There it is written over these methods // TODO: RE-Evaluate, where can I see what should be done with them? upd* I would like to use the standard classes if they suit me, but I still have to inherit for each type of block. I want to be inherited only in order to expand the block, and not to set the type and level of the tool, this is some kind of garbage. Can I solve this problem differently?
  8. Can you recommend some kind of library or API with which I can quickly understand the mechanisms? I'll start with:
  9. For example, I made 10 ItemTier (0-3 wood-diamond 4-13 my). I need to make all the blocks of each type (BlockClay, BlockGlowstone and other) from vanilla minecraft and set harvestLevel (private) to them. I need to override getHarvestTool () and getHarvestLevel () + add two fields to return values (and maybe even properties and a new constructor with these fields). To do this, I will need to inherit (duplicate) all classes in the mod and make such changes in each one. If I understand what I am offered to do. upd* I can override Block and rewrite everything else, inheriting from Block, but then ModBlockGlowstone! = BlockGlowstone, although they will be exactly the same. That's why I say that I will have to override every class in net.minecraft.block
  10. Should I constantly override Block # getHarvestLevel? And if I have 15 blocks and all have different levels? Should I do 15 classes? If I understand correctly, then harvestLevel is private so that programmers cannot change the blocks in the registry. But do I understand correctly that I must now redefine getHarvestLevel to all classes from net.minecraft.block? For example, if I want to create my own block of each type from vanilla minecraft? Am I already starting to write my library so that I would not override these types for every reason? Or is it not so gloomy? I just do not want to make a separate class for each block, as some mods do.
  11. Look net.minecraft.item.Items or net.minecraft.forge.ForgeRegistries. Your mod should have something like the first one. The event in the argument is needed to call the method when the event fires. For example, a game wants to spawn a mob, an event fires and calls your method. If you do not have an event in the method, it will not be called. It seems something like that, but I could be wrong.
  12. You want to say that this functionality already exists, I just do not know about it and therefore did not use it? I do not fully understand because of the language. You mean a specific parameter that I write in my advancment. Will it cancel vanilla advancment? *update I need to make the minecraft folder (in resources\data) , where should I put the redefinable advancement? Will there be problems with other mods that override advancement?
  13. Thanks for answers. I tried to insert advancement between vanilla advancement, but in the advancement menu I had 2 copies of advancement each. Vanilla and mine, but wrong, because One of my advancement got attached to vanilla. I thought it would be possible for me to override advancement if I write the same name, but the game loads two options, from minecraft and mod. There is a hunch that i need to find where minecraft stores these values and try to do something about it. But maybe I’m wrong again and there is a better way. smelt_iron.json iron_tools.json At the expense of question 5, I agree that this is a very aggressive way of solving a problem and it will cause a lot of problems in the work of the game itself. I realized this when I began to analyze possible examples of this approach. What is pr?
  14. Thank you, you have explained a lot. I haven't made a repository yet, but I'm working on it. Nevertheless, I think it is worthwhile to work on the classes, factories and interfaces (at least basic ones) inside Forge. If only because the Block class is the horror of the engineer. The remaining questions are still relevant, I will try to study myself how Forge and Minecraft work, but you can speed up this process.
  15. I had a similar problem. I installed jdk1.8.0_201 and it all worked. Specifically, my problem was related to the gradle and jdk version. If you follow the recommendations of gradle and run other commands, it should write what the problem is. Be sure to fix the %PATH%.
  16. Hello, I am new to the development of mods and I occasionally have questions. Perhaps they are stupid or something else, but I can not find some answer. English is not my native language, so I use a translator and there may be some errors. Most likely I will write additional questions here and I hope this topic will help someone. I also have plans to help with documentation and lessons, but for this I need to learn Forge. 1) How to add to the block the level of the tool used? I mean that the ore added by me could be mined with a pick not lower than iron. In the tool, this is set to ItemTier. I saw something similar at the end of the Block class and in ForgeHooks class. 2) How can I disable, delete or change vanilla blocks. 3) How can I make an intermediate advancement? For example, to have a copper pick between a stone pick and an iron ingot. How do I add opening recipes for this advancement? For example, how to open iron tools and armor after receiving an iron ingot. 4) How can I make my recipes go to the correct tabs in the recipe book? net.minecraft.client.util.RecipeBookClient 5) Can I just redefine some classes and somehow integrate them into the game, replacing the original ones? This would solve many problems. I am a beginner and therefore it is difficult for me to understand how forge works, mainly due to the lack of documentation and the small amount of comments to the code. Forge 1.13.2 is already sufficient to develop mods or I misunderstood and it is just being developed? This would explain the lack of simple and clear interfaces, factories and classes for the rapid development of modifications. Or maybe I'm blind and do not see (not understand) how to use Forge. I will be glad to receive any answer. For example, a link to an article, class, or at least a hint. If you add code samples or an explanation, it will be just fine. src.zip
×
×
  • Create New...

Important Information

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