trying to add compatibility with your mod addon of an addon but, it isn't simply getting the harvest level for anything but , vanilla. My mod sets the harvest level of blocks in the init stage you should get your info at the post init stage. It marks a checkbox even when I can't harvest it with that tool. It just checks if it's not vanilla is it pickaxe rather then trying to get the harvest level. I am on the latest 1.7.10.
Edit: It's ignoring the harvest level not scanning my current item's harvest level. It is ineffectively grabbing the wrong effective tool as my mod by default sets all blocks to all harvest levels of all specified tools it doesn't grab the right one just the latest. It says my modded blocks are pickaxe for the tool that's right however it still has the check like this box. My mod might set the harvest level for multiple tools at once but, it doesn't change the effective tool on the block since I don't know how to do that I think it's block material and I don't know how to change that from my mod.
When my tools are configed just to set it to just pickaxe it then goes ahead and grabs the right tool this time for vanilla however it then errors with any modded blocks. I am frustrated with this mod not working.
trying to add compatibility with your mod addon of an addon but, it isn't simply getting the harvest level for anything but , vanilla. My mod sets the harvest level of blocks in the init stage you should get your info at the post init stage. It marks a checkbox even when I can't harvest it with that tool. It just checks if it's not vanilla is it pickaxe rather then trying to get the harvest level. I am on the latest 1.7.10.
Edit: It's ignoring the harvest level not scanning my current item's harvest level. It is ineffectively grabbing the wrong effective tool as my mod by default sets all blocks to all harvest levels of all specified tools it doesn't grab the right one just the latest. It says my modded blocks are pickaxe for the tool that's right however it still has the check like this box. My mod might set the harvest level for multiple tools at once but, it doesn't change the effective tool on the block since I don't know how to do that I think it's block material and I don't know how to change that from my mod.
When my tools are configed just to set it to just pickaxe it then goes ahead and grabs the right tool this time for vanilla however it then errors with any modded blocks. I am frustrated with this mod not working.
Finally, Waila Harvestability should be doing the same (or similar) checks as the actual game when it determines whether or not you can harvest something. So if you're saying that the game does not allow you to harvest the modded blocks even though Waila Harvestability says that you can, then I'll look into it because that is a bug.
Alright I understand that all that you have said. I will make it only add one tool for the block if possible to support your mod. As for the bug could you fix this for 1.7.10 first though please? Thanks.
For the dev pictures I only made it add one tool. I tested this without it setting the harvest level via configs and it still did the same thing for my modded blocks. I think this a bug on your end as it didn't get the modded harvest level in the first place before saying you can harvest this block.
Here is my config set to one tool and nothing could possibly interfere as there is no line spacing besides the tool itself.
pickaxe
Edit: For some reason my harvest level stopped working and I don't know why it could be my mod. It printed out the blocks however it's not working anymore. I remember getting it working with material.rock but, nothing else and now it's not working at all.
I have also tried this in pre , init , and post init. It doesn't actually set the harvest level tell me what I am doing wrong since this was working before. This is taking the actual block and directly setting it so what is wrong with this code it still is dropping cobblestone.
I'm not sure what you think is incorrect. Unless I'm missing something, you're setting the harvest level to 0:
blockh.setHarvestLevel(tool, 0);
which means that any tool of that type can harvest that block (which is why it's showing "Pickaxe" with no harvest level in the Waila tooltip). What are you expecting Waila Harvestability to show?
yeah I gave you outdated code I have directly modified the code in yesterdays test to the harvest level recheck this pastebin it should be fine now. Also I have just plain out set the harvest level nothing seems to be working now. Even when nothing was working this code here below itself I have tried in init pre init post init and it's still dropping it's drops of cobblestone. Here below is the harvest level I have no clue what is going on here. I will come back here once I get this working for some reason nothing wants to work right now. It worked two days ago
Blocks.cobblestone.setHarvestLevel("pickaxe", 3);
This is the up to date code sorry I forgot I reset my code last night.
Your mod seems to work perfect it's forge itself that needs a patching. It doesn't set the harvest level by itself unless you install either optifine or minetweaker which I have both. It doesn't seem to set the harvest level for modded blocks this is an issue with forge itself don't worry about this unless you want to make an asm core mod patch. It seemed to work fine with bedrock setting the harvest level but, blocks that already have it like cobblestone doesn't work.
I don't normally ask this but, could you add compatibility since my mod simulates the actual harvest level and will set the block to air if it's not the right harvest level. I get my data values from HarvestLevel.txt in block properties This is created in the init stage so you could create the compatibility to the post init stage. My source code is in the jar itself and the latest version for 1.7.10 is 1.4.7 and seems to be stabilized. If you don't want to read things from a text file just dirrectly use my public static array list in my main java file which contains all of the modid:block=value. I suggest splitting it from the = sign and from the right hand side then from that string use Integer.parseint() and that will give you the value. Now do this in a while loop then apply the code to override your default settings. Don't just support my modded blocks because, my harvest level .txt file can be used for any block in the game and it seems to work with any modded block I have tested it with.
Edit: don't bother adding comparability yet I am working on getting the other half of the simulation and once that is in a working state I will msg you if you want. This is starting to crowd up the forum I suggest taking this to an msg.
For modded blocks, setHarvestLevel should work fine unless the modded block changes the implementation of Block.getHarvestLevel or Block.setHarvestLevel. If that's the case, then there might not be much you can do.
I was literally testing this with nei, code chicken core, waila , and your mod, and sometimes with minetweaker and optifine.
I just tested this in post init http://pastebin.com/Hz2inxLp . I saw the github there must be more to this. I just did what he did. He is modifying the tools I don't want to go to that extent simply because, there is an issue with forge. It doesn't really work with every block still. I just confirmed this has been a long standing issue with forge here https://github.com/MinecraftForge/MinecraftForge/issues/3277 . So I guess if you don't want to add support I am going to get alot of people complaining why is your harvest levels not working when in reality it's from forge not doing the harvest levels right so I had to make an artificial one. I have looked at the block class none of them that I have tested set their own harvest levels as their are block = new block at least the ones I have tested.
You're misunderstanding the problem. You need to somehow initialize ForgeHooks before you do any setHarvestLevel calls. There is no bug with the harvest level code itself, it's in the order that things get called. Try this code, for example:
Ok this should work for normal blocks however since spawners a special case It needs to be at harvest level 0. How should I add support for your mod when it comes to spawners. The harvest level for spawners in defined spawners.txt file means if it's level 10 let's say if you have a wooden pickaxe it will still contain it's xp drops but, it won't drop it's block or case without silk touch or specified enchantments and only if that pickaxe is level 10. I will move my code now over to post init. I will have the same issue for 1.10.2 because, although harvest levels now then works for that version spawners are a special case and will always be set to 0 but, won't drop it's without specified enchantment.
Again if your harvest level is higher then your tool no matter what tool it should say you can't harvest it. I set my harvest level up if the tool material allows it for you to break it with your fist else you need a tool and that harvest level is set with that tool. If you have a tool in your hand then It should recalculate if you can't harvest it. This here isn't doing this. O and It seems to be getting the wrong tool if a block before it set it's harvest level with a different tool. Ignore the tool harvest level I just caught that It turns out my mod is errored for that part however when it was showing the shovel it still showed the checkbox . I have no clue why it is erroring. It is in the while loop so?????
What I am looking to do
I am looking to replace your values under certain instances from my spawner array list. I want to change the display harvest level blue if it's the right tool and virtual harvest spawner level, red if it's not along with the checkbox showing accordingly and I would also like it to show the specified enchantments from my config. In the future it will be more complex saying It per block since in the future there will be a block enchantment override file saying you need these enchantments for this block and it ignores the global enchantments. I would also like a graphical effect over waila looking like it's enchanted type of thing (that might be too much to code for me). Please explain to me what I should do and a generalization of how your code works and where I should be looking.
What I would like you to do
Fix up your code so when I have a shovel and grass harvest level is 3 and I have a iron shovel it should say I can't harvest it. However if the material has no tool association and you have no tool in your hand then I would like you to say you can harvest it. Of course it would still drop the blocks so only do this if silkspawners (my modid). Do this for 1.7.10, That would do your part then I could do mine. 1.8, 1.8.9, 1.10.2
I'm hesitant to believe that there's something wrong with my mod in this case. If you can show a case where my mod is saying something is currently harvestable when it is not, or where my mod is saying something is not currently harvestable when it is, then I'll look into it.
For grass, look at Material.isToolNotRequired()--a tool being effective and a tool being required are separate things. There are a lot of edge cases and hard-coded special cases that you have to take into account. What is and isn't harvestable is not as simple as you might think.
If you are making a mod that changes how the harvest level system works, then let me know when you've finished it, provide an API to retrieve the necessary information, and I'll see about adding support for it. Until then, I don't think there's much I can help you with.
I guess What I am asking is for a display override file. I did make some changes but, there is no need for anything of you to do except to make an override file. I messaged you the details. Make the file public static and don't use buffered file readers or writers as they will re-write your file every launch. if your file is public static I can just write straight to your override file based on the user input files for the display overrides.
Thanks for saying I could call new forge hooks in order for forge to work with something if it wasn't already working. This also saved me when I was making a more advanced config for dungeon config on world load to fix some bugs. I called new DungeonHooks(); then it started working completely.
In the Waila options menu. Default keybind is Numpad 0.
trying to add compatibility with your mod addon of an addon but, it isn't simply getting the harvest level for anything but , vanilla. My mod sets the harvest level of blocks in the init stage you should get your info at the post init stage. It marks a checkbox even when I can't harvest it with that tool. It just checks if it's not vanilla is it pickaxe rather then trying to get the harvest level. I am on the latest 1.7.10.
Edit: It's ignoring the harvest level not scanning my current item's harvest level. It is ineffectively grabbing the wrong effective tool as my mod by default sets all blocks to all harvest levels of all specified tools it doesn't grab the right one just the latest. It says my modded blocks are pickaxe for the tool that's right however it still has the check like this box. My mod might set the harvest level for multiple tools at once but, it doesn't change the effective tool on the block since I don't know how to do that I think it's block material and I don't know how to change that from my mod.
When my tools are configed just to set it to just pickaxe it then goes ahead and grabs the right tool this time for vanilla however it then errors with any modded blocks. I am frustrated with this mod not working.
More details
Modded Block same harvest level of 2
You can look at the source code to see how the mod retrieves the harvest level info. It's all done at runtime. For your specific case, you should make sure that your Block class returns the correct number from Block.getHarvestLevel(int meta).
Note also that Minecraft does not have proper support for 'multiple effective tools', as the method to retrieve the effective tool returns a single string (see this code for how it's retrieved in Waila Harvestability).
Finally, Waila Harvestability should be doing the same (or similar) checks as the actual game when it determines whether or not you can harvest something. So if you're saying that the game does not allow you to harvest the modded blocks even though Waila Harvestability says that you can, then I'll look into it because that is a bug.
Alright I understand that all that you have said. I will make it only add one tool for the block if possible to support your mod. As for the bug could you fix this for 1.7.10 first though please? Thanks.
For the dev pictures I only made it add one tool. I tested this without it setting the harvest level via configs and it still did the same thing for my modded blocks. I think this a bug on your end as it didn't get the modded harvest level in the first place before saying you can harvest this block.
Here is my code:
http://pastebin.com/hEYbss32
Here is my config set to one tool and nothing could possibly interfere as there is no line spacing besides the tool itself.
Edit: For some reason my harvest level stopped working and I don't know why it could be my mod. It printed out the blocks however it's not working anymore. I remember getting it working with material.rock but, nothing else and now it's not working at all.
I have also tried this in pre , init , and post init. It doesn't actually set the harvest level tell me what I am doing wrong since this was working before. This is taking the actual block and directly setting it so what is wrong with this code it still is dropping cobblestone.
I'm not sure what you think is incorrect. Unless I'm missing something, you're setting the harvest level to 0:
blockh.setHarvestLevel(tool, 0);
which means that any tool of that type can harvest that block (which is why it's showing "Pickaxe" with no harvest level in the Waila tooltip). What are you expecting Waila Harvestability to show?
yeah I gave you outdated code I have directly modified the code in yesterdays test to the harvest level recheck this pastebin it should be fine now. Also I have just plain out set the harvest level nothing seems to be working now. Even when nothing was working this code here below itself I have tried in init pre init post init and it's still dropping it's drops of cobblestone. Here below is the harvest level I have no clue what is going on here. I will come back here once I get this working for some reason nothing wants to work right now. It worked two days ago
This is the up to date code sorry I forgot I reset my code last night.
http://pastebin.com/hEYbss32
Your mod seems to work perfect it's forge itself that needs a patching. It doesn't set the harvest level by itself unless you install either optifine or minetweaker which I have both. It doesn't seem to set the harvest level for modded blocks this is an issue with forge itself don't worry about this unless you want to make an asm core mod patch. It seemed to work fine with bedrock setting the harvest level but, blocks that already have it like cobblestone doesn't work.
I don't normally ask this but, could you add compatibility since my mod simulates the actual harvest level and will set the block to air if it's not the right harvest level. I get my data values from HarvestLevel.txt in block properties This is created in the init stage so you could create the compatibility to the post init stage. My source code is in the jar itself and the latest version for 1.7.10 is 1.4.7 and seems to be stabilized. If you don't want to read things from a text file just dirrectly use my public static array list in my main java file which contains all of the modid:block=value. I suggest splitting it from the = sign and from the right hand side then from that string use Integer.parseint() and that will give you the value. Now do this in a while loop then apply the code to override your default settings. Don't just support my modded blocks because, my harvest level .txt file can be used for any block in the game and it seems to work with any modded block I have tested it with.
Edit: don't bother adding comparability yet I am working on getting the other half of the simulation and once that is in a working state I will msg you if you want. This is starting to crowd up the forum I suggest taking this to an msg.
@themodpackmaker
I'm not very interested in adding special support for your mod, sorry.
For cobblestone, you might be setting the harvest level before Forge sets it, and then it could be getting overwritten by Forge. The default Block.getHarvestLevel/Block.setHarvestLevel methods only allow a single value at a time, so whoever sets the harvest level last will take precedence. See this code for how Iguana Tinker Tweaks gets around this issue (maybe not the best way, but it works).
For modded blocks, setHarvestLevel should work fine unless the modded block changes the implementation of Block.getHarvestLevel or Block.setHarvestLevel. If that's the case, then there might not be much you can do.
I was literally testing this with nei, code chicken core, waila , and your mod, and sometimes with minetweaker and optifine.
I just tested this in post init http://pastebin.com/Hz2inxLp . I saw the github there must be more to this. I just did what he did. He is modifying the tools I don't want to go to that extent simply because, there is an issue with forge. It doesn't really work with every block still. I just confirmed this has been a long standing issue with forge here https://github.com/MinecraftForge/MinecraftForge/issues/3277 . So I guess if you don't want to add support I am going to get alot of people complaining why is your harvest levels not working when in reality it's from forge not doing the harvest levels right so I had to make an artificial one. I have looked at the block class none of them that I have tested set their own harvest levels as their are block = new block at least the ones I have tested.
@themodpackmaker
You're misunderstanding the problem. You need to somehow initialize ForgeHooks before you do any setHarvestLevel calls. There is no bug with the harvest level code itself, it's in the order that things get called. Try this code, for example:
http://pastebin.com/jcQcmHDS
Ok this should work for normal blocks however since spawners a special case It needs to be at harvest level 0. How should I add support for your mod when it comes to spawners. The harvest level for spawners in defined spawners.txt file means if it's level 10 let's say if you have a wooden pickaxe it will still contain it's xp drops but, it won't drop it's block or case without silk touch or specified enchantments and only if that pickaxe is level 10. I will move my code now over to post init. I will have the same issue for 1.10.2 because, although harvest levels now then works for that version spawners are a special case and will always be set to 0 but, won't drop it's without specified enchantment.
I'm not sure what the tooltip should even look like for a dual harvest level system like that.
tooltip? what tooltip It displays Harvest level 0 If it's a spawner.
Code: https://gist.github.com/jredfox/eb2e2684f67054879fa36e7ef6f6e78e
Issues With your mod
Again if your harvest level is higher then your tool no matter what tool it should say you can't harvest it. I set my harvest level up if the tool material allows it for you to break it with your fist else you need a tool and that harvest level is set with that tool. If you have a tool in your hand then It should recalculate if you can't harvest it. This here isn't doing this. O and It seems to be getting the wrong tool if a block before it set it's harvest level with a different tool. Ignore the tool harvest level I just caught that It turns out my mod is errored for that part however when it was showing the shovel it still showed the checkbox . I have no clue why it is erroring. It is in the while loop so?????
What I am looking to do
I am looking to replace your values under certain instances from my spawner array list. I want to change the display harvest level blue if it's the right tool and virtual harvest spawner level, red if it's not along with the checkbox showing accordingly and I would also like it to show the specified enchantments from my config. In the future it will be more complex saying It per block since in the future there will be a block enchantment override file saying you need these enchantments for this block and it ignores the global enchantments. I would also like a graphical effect over waila looking like it's enchanted type of thing (that might be too much to code for me). Please explain to me what I should do and a generalization of how your code works and where I should be looking.
What I would like you to do
Fix up your code so when I have a shovel and grass harvest level is 3 and I have a iron shovel it should say I can't harvest it. However if the material has no tool association and you have no tool in your hand then I would like you to say you can harvest it. Of course it would still drop the blocks so only do this if silkspawners (my modid). Do this for 1.7.10, That would do your part then I could do mine. 1.8, 1.8.9, 1.10.2
I'm hesitant to believe that there's something wrong with my mod in this case. If you can show a case where my mod is saying something is currently harvestable when it is not, or where my mod is saying something is not currently harvestable when it is, then I'll look into it.
For grass, look at Material.isToolNotRequired()--a tool being effective and a tool being required are separate things. There are a lot of edge cases and hard-coded special cases that you have to take into account. What is and isn't harvestable is not as simple as you might think.
If you are making a mod that changes how the harvest level system works, then let me know when you've finished it, provide an API to retrieve the necessary information, and I'll see about adding support for it. Until then, I don't think there's much I can help you with.
I guess What I am asking is for a display override file. I did make some changes but, there is no need for anything of you to do except to make an override file. I messaged you the details. Make the file public static and don't use buffered file readers or writers as they will re-write your file every launch. if your file is public static I can just write straight to your override file based on the user input files for the display overrides.
Thanks for saying I could call new forge hooks in order for forge to work with something if it wasn't already working. This also saved me when I was making a more advanced config for dungeon config on world load to fix some bugs. I called new DungeonHooks(); then it started working completely.
So can you make a display override file for me? That's all I am asking for you to do
I am using in my modpack CzechPack which will be uploaded onto the technic platform just asking for permission first.
would it be possible to release 1.11 build using Hwyla, a fork of Waila?
Yes, will try to do that soon, but not sure when.