Jump to content

Koward

Forge Modder
  • Posts

    141
  • Joined

  • Last visited

Everything posted by Koward

  1. I would like to change the base knockback applied when you punch a mob (without any item). There's no way to change that at the moment. I tried a work around applying a "reverse knockback", but has it depends on random values sometimes the knockback would still happen or only the reverse one, resulting in "pulling" the mob towards the player. There are also other mechanics in this method that could be useful for some modders.
  2. Hello, I would like to edit the way attack is done in EntityLivingBase#attackEntityFrom(DamageSource source, float amount). I could cancel LivingAttackEvent and apply the effects myself, but obviously the return value of attackEntityFrom would always be false which could break many parts of the game. If instead of always returning false, we could set the return value via a result of the event, it would allow us that kind of modification. So, to quote the doc, instead of "If this event is canceled, the Entity does not take attack damage." it would be "If this event is canceled, no more computation is done. the Entity does not take attack damage. If the result is DENY, the Entity did not take attack damage". A DEFAULT to false would not break existing mods.
  3. Well it's a bit hard to help "just like that", all I can recommend you is to watch CPW's video ( https://www.youtube.com/watch?v=yanCpy8p2ZE ) if it's not already done. There is already a PR to extend substitution, but it's for 1.10 so this one will not be accepted. You can find it here : https://github.com/MinecraftForge/MinecraftForge/pull/3462 Maybe there could also be a method in IForgeRegistry<T>, that would feel consistent with the new register events introduced in 1.11. But all of this is a bit useless if that bloody bug is left unfixed ><".
  4. Your problem could still reappear later with your mod. If you register or substitue new items, for example. If it happens try changing the order of registration or try to register placeholder entries. I reported this bug with substitution here : https://github.com/MinecraftForge/MinecraftForge/issues/3837 Note I said 19 in the report, but I think there are other value threshold than can trigger the bug. I have been trying for the last few days to precisely figure out the pattern without much success, but there's definitely one. Your classes&JSON are good and unrelated with this.
  5. Hello. For some months I encounter a bug preventing me from using GameRegistry.addSubstitutionAlias. Since I saw at least some people on this forum got it working, I'm posting hoping to get some help. I always substitute things at the Register<Block> event. What I do for my Blocks is GameRegistry.addSubstitutionAlias(oldBlock.getRegistryName().toString(), GameRegistry.Type.BLOCK, newBlock.setRegistryName(oldBlock.getRegistryName().getResourcePath()).setUnlocalizedName(oldBlock.getUnlocalizedName().split("\\.")[1])); Crash log : https://pastebin.com/riFX21WF I'm not sure what could be wrong. EDIT : Problem solved. As I was not using the Item object for anything other than the substitution I did not hold it in a static reference, instead creating it directly when passing the parameters of addSubstitution. This probably resulted in two separate instances for each thread and funky times.
  6. Imagine you use builtin capabilities made for Forge Energy. You could create in your mod a machine that outputs Forge Energy. If another mod has a machine that receives Forge Energy, it will work with your FE machine too. Imagine you create new capabilities for your energy, then it will only work with machines made for that energy too. And that's why when people got the idea "machines from many mods compatible together" they needed a standard. For a long time this standard has been RF, now it's becoming FE.
  7. I do not interpret Lex's message the same way. Of course anyone can use, or not, the Forge capabilities. You can always do whatever energy system you want, that's obvious. But if you want to operate with other mods machine, you have to set a standard. Many energy systems, like RF, were meant to be universal standards, a lot of them proliferated. Now Forge uses its de facto authority to set the new standard. If you want your machine to not work with/like Forge Energy machines, you can create your own energy with new capabilities (there are a lot of very good reasons to do that). If you want to do compatible machines that use the same Energy as the majority, you use Forge Energy.
  8. If I remember RF is basically completely deprecated. All mods should move to the standard energy offered directly by Forge.
  9. You can't. There is nothing triggered before generation of every tree. The Decorate event is triggered once before the generation of all trees, though. You may cancel it then generate things your own way. Find with your IDE where it's triggered in the code and you'll see how vanilla spawns all of its trees.
  10. As I said the event is triggered once before all pumpkins are generated in chunk. Not for each pumpkin. You have to mimic the way pumpkins are generated. In vanilla (note : build 1.10.2 2185, check if it's the same for you, it's in BiomeDecorator.java), that is : if (random.nextInt(32) == 0) { int i5 = random.nextInt(16) + 8; int k9 = random.nextInt(16) + 8; int j13 = worldIn.getHeight(this.chunkPos.add(i5, 0, k9)).getY() * 2; if (j13 > 0) { int k16 = random.nextInt(j13); (new WorldGenPumpkin()).generate(worldIn, random, this.chunkPos.add(i5, k16, k9)); } } (Use the random of the Decorate event, else you'll break seeds). I found this by looking with my IDE where the Decorate event was called, and I saw the one where the type PUMPKIN is checked. If you paste this code in your event, vanilla pumpkins will generate. Now if you want something different, you have to create a new WorldGenPumpkin. Just extend it and override the methods you need (probably at least generate() as it's called there). The pos that's given by the event are coordinates of the chunk (or at least the chunk cross-shaped intersection, but that's the idea). So it's basically a position on a 2D map seen from above, and a y value would be meaningless. That's why y = 0. Anyway you do not need it for pumpkins. If you wanted to edit trees that would have been trickier because some data used to calculate them are not passed to the event, but for pumpkins everything seems okay.
  11. I would never have been able to find this, thank you. I have a new bug with the grass slab whose color is not correct anymore, but I'm sure that's not as tricky as the previous issue. EDIT : fixed by setting the model at the variant level (each time setting block/half_slab). So no dummy needed anymore. Maybe that's why the format requires it ?
  12. Could you show the code where you catch the event ?
  13. Hi, You could subscribe to DecorateBiomeEvent.Decorate and check event.getType() to PUMPKIN. It triggers before all pumpkins in the chunk. So you cancel it with setResult, then you do whatever you want.
  14. I have a Github repository here : https://github.com/Koward/BetterWithMods/commits/ground (It's a fork, I'm only contributor) After the commit 817a the models don't work (Forge format). Before that it works using multiple models and vanilla format. I really wonder how something like that can happen. I don't use any special state mapper.
  15. I'd like to reup this thread. In the end I have never managed to do what Choonster did in his mirror_plane.json. The json is here : http://pastebin.com/8PRtt1YD The log is here : http://pastebin.com/mPGEPdLs As you can see, the variants can't be found. The items freak out too. When using vanilla variants that points to separate models, everything works, but it takes a lot of short json files.
  16. I'm afraid this results in the screen freezing at ModelLoader: blocks - minecraft:grass, always. Log : https://hastebin.com/iyokelimov.md EDIT : maybe it's related to https://github.com/MinecraftForge/MinecraftForge/issues/3219
  17. Hello, I'm currently using GameRegistry#addSubstitutionAlias to replace the grass block by mine. Sometimes the game crash when I run it, sometimes not. I don't see any pattern. Here's the log when it crashes : https://hastebin.com/oyovoqubag.md To replace it, all I do is GameRegistry.addSubstitutionAlias( "minecraft:grass", GameRegistry.Type.BLOCK, new BlockGrassCustom().setRegistryName("grass_custom").setUnlocalizedName("grass")); in preInit. Anyone encountered such issue before ?
  18. You can find the code with the Github links I gave in my post. In my method, x and z are World-based coordinates. The only time I use something Chunk-based is to get the highest block, and I explicitly convert x and z with &15. There's no getType() because it would not make any sense. The Decorate event is triggered before the generation of all <getType>. Before generation of trees, before generation of pumpkins, etc. The Post event is triggered after the generation of everything. We look for trees in the actual, final, generated world. I defined a pattern "tree" as some suitable block (like dirt or grass) with two logs above it, feel free to adapt the code for any other use. I'm aware my solution is not ideal, but I can't see a better one without new Forge hooks. About LOG2&LEAVES2, it's just Mojang who created new blocks when Acacia and Dark oak trees were added.
  19. I wrote something exactly like that some weeks ago for a project I contribute to. It works well but it also identifies 4 logs in some village houses (bottom corners). I can't see a way to fix that. The idea is : For each position in a 16x16 chunk intersection (cross shaped, that's what is populated after the event) start from the heighest block and go down until it reaches the terrain surface. Then, look two blocks above to check if they are logs. Your mistake was to use the Decorate event. If you look where it's called, you'll see it's called before tree (and big mushroom) generation. It's not something triggered for individual trees, you actually need to iterate through the chunk intersection. Actual source on Github : https://github.com/BeetoGuy/BetterWithMods/blob/master/src/main/java/betterwithmods/event/StumpingEventHandler.java https://github.com/BeetoGuy/BetterWithMods/blob/master/src/main/java/betterwithmods/blocks/BlockStump.java
  20. That's amazing. Still, the ability of setting just some different textures at the blockstate level is great, that reduce the number of files quite a lot. My problems are solved, thanks a lot guys.
  21. The multipart format don't see to support textures unfortunately. Does that mean I'll have to make 3*2 models (+1 for the parent) ?
  22. Can we even specify combinations with the Forge format ? My snowy variant don't always apply the same textures when true, it depends of the variant used. All I have ever seen is { "forge_marker": 1, "defaults": { }, "variants": { "my_boolean_property": { "true": { }, "false": { } }, "my_enum_property": { "a": { }, "b": { }, "c": { } } } } I would need to get the boolean property inside each of enum options. Is it supported ? This is not obvious by the doc http://mcforge.readthedocs.io/en/latest/blockstates/forgeBlockstates/ . The way the vanilla formats are described at http://minecraft.gamepedia.com/Model looks much more complete and reliable.
  23. Hi. I'm trying to make a slab model, and I'm getting upward references exception. But I really don't see where I put the cart before the horse. The block has two properties, enum "variant" and boolean "snowy". Blockstate JSON : https://hastebin.com/netecubaji.json Model JSON : https://hastebin.com/zucijeqari.json Log of a run : https://hastebin.com/ebavohanip.md Screenshot ingame : http://i.imgur.com/jQzShNq.png Note I only get errors for #side, but no textures are displayed at all.
  24. I compensate the cross-chunk nature by offsetting x and z by 8. I'm not iterating over the chunk anymore, I actually iterate over the intersection that should generated at the time of the event (so 4 quarters of 4 different chunks). I have not found any missing tree yet, but I'll keep an eye.
  25. I think the event I use is triggered before village generation. If it's not then checking for two vertical logs should do the trick. About gravel trees... Damn. I could add gravel too along with dirt. Thin air trees on the other hand will be discarded, not a big deal. I use this at world gen, so nobody has built anything yet. There's no such event, that's why I have to iterate through the blocks this way. The events are triggered before or after everything, not individual features. EDIT : I think I found one of my problems. Basically, chunk.getBlockState() is NOT just a world.getBlockState() with chunk coordinates. When you use the chunk version, you only ever get terrain stuff like grass block, dirt, gravel, sand. No features at all (leaves, tall grass, flowers, logs..). I used the world version and I got what I wanted. Now just a few tweaks and I'll post here my progress. EDIT2 : It does not get all trees, only some. Seems just 1/4 of chunk is tagged. http://hastebin.com/buwomusoku.java EDIT3 : Solved (Chunk coord were wrongs). I'll update OP with the latest version.
×
×
  • Create New...

Important Information

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