-
Posts
141 -
Joined
-
Last visited
Everything posted by Koward
-
[sOLVED] Here's the final version of the event : http://hastebin.com/xomoqahepo.java It replaces the bottom block of each trees by a glowstone block (helped during debug to see which trees were counted). ---- Hello, I'd like to iterate over all trees when they are generated and do various things like changing blocks around. To start with something smaller, I'd like to simply find them and count them. I consider the bottom of a tree as a (hopefully unique in World gen) pattern with a block of dirt beneath a log. I wrote this event : http://hastebin.com/buwomusoku.java Unfortunately not all trees are counted. It seems only a part of the chunk is actually tagged. I was told the decoration was done not per chunk but for intersections between 4 chunks. I tried to simply add an offset of 8, but well the problem was just swapped between chunks. I just don't see how to iterate properly through blocks after biome generation. I'm a bit lost and I would appreciate a lot any support.
-
Hello, For one of the projects I'm working on we would like to rename some of our entities (one has a typo and we would also like to snake_case the others, as it now seems to be the convention). However it makes them disappear from the world and I'd like to avoid that. There is a solution for similar problems with Blocks, Items, TileEntities.. but I could not find anything for entities. Any idea ?
-
I know how it happened : he copy pasted the signature of the superclass method, which was deobfuscated using 1.10.2 mappings while on 1.11. A new parameter was added in the new version hence the "shift" in parameters name. It does not excuse the mistake, but it's an explanation. @OP update your mappings. Newest ones are compatible with 1.11. Also, your register entities is garbage. You use the same resource location for all entities, very stupid. Each entity needs its own.
-
[1.10][Solved] Edit (or simulate editing) vMC tool materials
Koward replied to Koward's topic in Modder Support
It worked perfectly. Thanks a lot diesieben. -
[1.10][Solved] Edit (or simulate editing) vMC tool materials
Koward replied to Koward's topic in Modder Support
The values are taken from the material in the constructor of ItemTool. Except enchantability. protected ItemTool(float attackDamageIn, float attackSpeedIn, Item.ToolMaterial materialIn, Set<Block> effectiveBlocksIn) { <...> this.toolMaterial = materialIn; this.effectiveBlocks = effectiveBlocksIn; this.maxStackSize = 1; this.setMaxDamage(materialIn.getMaxUses()); this.efficiencyOnProperMaterial = materialIn.getEfficiencyOnProperMaterial(); this.damageVsEntity = attackDamageIn + materialIn.getDamageVsEntity(); <...> } The vanilla items are instanciated before preInit so it will already be too late. -
[1.10][Solved] Edit (or simulate editing) vMC tool materials
Koward posted a topic in Modder Support
Hello, I'd like to change the values set in original vanilla tool materials. ... WOOD(0, 59, 2.0F, 0.0F, 15), STONE(1, 131, 4.0F, 1.0F, 5), IRON(2, 250, 6.0F, 2.0F, 14), DIAMOND(3, 1561, 8.0F, 3.0F, 10), GOLD(0, 32, 12.0F, 0.0F, 22); ... (as seen in Item.ToolMaterial) I'd like to edit maxUses, efficiency and enchantability. I can edit maxUses afterwards with Item#setMaxDamage() so that's not a big problem, but the two others are not accessible. With reflection on ItemTool.efficiencyOnProperMaterial I could change efficiency, but enchantability is a direct call to toolMaterial.getEnch..(). Only other option I can think of is creating new materials with EnumHelper, recreate all vanilla tools and use substitution, but even then if some mod (or myself if I forget) compares the material it won't work. Is there any better way for this ? -
[1.10.2][SOLVED] MultiModel minecraft:builtin/missing is empty
Koward replied to Koward's topic in Modder Support
(It's one month old, I hope not enough to be a necro) There's absolutely zero mention of builtin/missing in the project. This just cannot be the cause. By adding/removing files I have narrowed it down to blockstates. I'm looking for another kind of error in the JSON. Will update if anything new. EDIT : Narrowed it down to one JSON blockstate file that is the cause of all error lines (dozens !) The author of the JSON (nop, not me, that's a project) apparently wanted an empty model for a light source and wrote a wrong JSON : http://hastebin.com/zifagicobi.json -
Hello, While everything is perfectly fine in game, I have many errors displayed at launch. Those errors are [Client thread/ERROR] [FML]: MultiModel minecraft:builtin/missing is empty (no base model or parts were provided/resolved) Here's the part of the log with all of them : http://hastebin.com/oropesitil.md I see no information about what could be causing this. I have googled the error to no avail. If anyone knows when this kind of error spawns, that would be helpful.
-
I'm sorry, I read your post too fast. Use EntityPlayer : public ItemStack getHeldItemMainhand() (or Offhand if you want). You get an ItemStack, which has a metadata value. Use ItemStack : public int getMetadata(), and compare it with the metadata of one of the BlockStone.EnumType you want (getMetadata() too). This way, no deprecation at all, you're as ready as possible for the future.
-
Hi ! You compare the blockstate with Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.STONE). Here I put EnumType.STONE, other variants work the same way.
-
[1.10.2] Check if singleplayer and get the player
Koward replied to Koward's topic in Modder Support
In the end I just made a synchronization between client and server with packets, so I'm sure I use the server config for this particular setting. -
Hi, I have been asked to provide a config option in a mod I made some contributions to. It's a replacement of the food system of the player, done at EntityJoinWorldEvent. When the player disable in-game via GUI the option, it should revert back (or apply if it was off). This only happens in single player of course, else players could have different systems on the server. I subscribe to OnConfigChangedEvent, but I do not know how to check if it's a single player world anymore. Then I'll need the (single) EntityPlayer to revert my changes. Any idea ?
-
A way to add Mojang's new variants in the future, along with ours ?
Koward replied to Koward's topic in Modder Support
The problem will then happen when I add new wood types, the very same way. -
Hello. I have multiple blocks that currently use Mojang's BlockPlanks.EnumType. If Mojang ever add a new type of wood, new matching blocks will be created. So far so good. I may also like to add new wood types myself, and would want the same behavior. I can add new stacks to getSubBlocks() and change other methods that handles states and meta. It works, but is it safe for worlds in the future ? I'm not so sure. Current metadata values (with 6 Mojang types and 3 mod types) : 012345 678 If Mojang adds a new wood type : 0123456 789 <= Shifted, wood types of blocks in the world will change at login with new version ! Is there an elegant solution to solve this or do we have to manually add all woods to our own custom enum ?
-
If one wants to affect all knockbacks, the already existing attribute works fine. Maybe a getBaseKnockback() { return 0.5F; } in EntityLivingBase ? I have never made a Forge PR, I don't really know yet what's good practice, but I'll look at it.
-
Hello, When you (or any living thing) attack a mob (whether a monster or a mob) with your fist or anything that is not a tool, you apply a knockback on it. This is handled by EntityLivingBase.attackEntityFrom(DamageSource source, float amount). if (source.getSourceOfDamage() instanceof EntityLivingBase) { ((EntityLivingBase)source.getSourceOfDamage()).knockBack(this, 0.5F, this.posX - source.getSourceOfDamage().posX, this.posZ - source.getSourceOfDamage().posZ); } I'd like to change this "0.5F" value. It represents the base knockback force. We could increase or decrease it. Anyone would have an idea about how to edit it ? Notes about what I already tried : -LivingAttackEvent is triggered before the knockback, so we can't just cancel it by "pulling" the mob afterwards. Pulling it before looks glitchy. -SharedMonsterAttributes.KNOCKBACK_RESISTANCE affects all knockbacks (and there are many, many many cases where it's used) so that's not an option. -LivingHurtEvent is triggered for all damage and without way of knowing who did it so it's not possible either.
-
There is net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed event with everything you need =) You can there change the speed according to various things including the player, check all its methods.
-
I don't think there's such thing as an "original Hardness". setHardness is just a setter to an hardness value stored in the block instance. The "original" hardness the block may have been set at in the constructor or right with registering has been set the same way, and if someone call setHardness after that it just overrides the old value. You had in mind that setHardness influenced some modifier that multiplies the "base hardness" but if I'm correct that not the case. Again, you can check all that by following the source. Just see what setHardness actually does. F3 if you're using Eclipse. Maybe what you try to achieve can be done in another way. Feel free to share your more global idea !
-
That's one case. One case is easy to maintain. If you want to substitute let's say 25 items/blocks you may have a dozen different cases and events where you remove the old and replace with the new. At each update those can potentially change and break partially or completely your code. That's why substitution would be easier to maintain. It's an abstract task, the way it works internally could be updated, improved by the Forge team in the future without us having to worry about it at all.
-
Indeed. If the substitution is a complete equivalent of solution 1. I have not tested something : while I know alias replaces old item in stacks and a few other instances, I've yet to check if the original instance saved in Items (for vanilla) is replaced too (whether all item == Items.BOW would become true for a Items.BOW alias), else that means substitution would not be completely equal to solution 1 in some cases.
-
Hello. The substitution mechanism allows to alias an item/block with one of our own. Though added a long time ago it started working well only recently, thanks to all those who worked on it. Imagine one wants to modify a vanilla item, for whatever reason. He extends it and then two ways appear : [*]Remove all ways and references to obtain the item and re-add these with the custom item. [*]Use substitution to create an alias. My question is : which solution would provide the most elegant and easy to maintain code, and what are the trade-offs and limitations of each way ?
-
Would Forge, MCP and Spigot teams be willing to work with Mojang?
Koward replied to Starless's topic in Minecraft General
So he works on the deobfuscation of the code owned by the very company he works for. ¯\_(シ)_/¯ -
Add multiple Forge versions into individual MC launcher profiles
Koward replied to Sir_Jave's topic in Suggestions
It is beyond the logic skills of a mere mortal : if mod A is designed for version X, and mod B is designed for version Y, well obviously the answer to all conflicts is to install each version on top of each other. It's a perfectly designed plan. What could go wrong ? -
Dynamic Heat and seasons: would this melt a server?
Koward replied to ddayboy91920's topic in General Discussion
Yes, but it's a static value. It's a per biome type temperature. OP wants to basically add per block (every single block) and heat would go from block to block, with different transfer speeds based on material. -
I needed this for all items.. *Sigh* I guess it seems I'll have to customize every single Item in Minecraft if I ever want to do that. I often like to do generic things that can have lots of uses, but you're right I should have added a clear example.