Posted May 25, 20196 yr I make bedrock breakable for 750.0f but then the bedrock wasn't added to the stat list. I don't know how how to add it to the stat list. Edited August 13, 20196 yr by Issac29
May 26, 20196 yr You can't. There's a function that sets stats off, but as it defaults to on, there's no method that turns the value back on. And given that bedrock can't be broken by any means that would ever trigger stats, there's no point. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 26, 20196 yr Author Also because I made bedrock breakable but it takes a long time to break, there has to be a way. Edit: the Hardness was negative one then at 450F. Edited May 26, 20196 yr by Issac29 Forgot one
June 5, 20196 yr Author On 5/25/2019 at 10:30 PM, Draco18s said: And given that bedrock can't be broken by any means that would ever trigger stats, there's no point. Normally bedrock is unbreakable but the changed code allows to make bedrock breakable with some edited java code. Like This: Blocks.BEDROCK.setHardness(30.0F)
June 5, 20196 yr 14 minutes ago, Issac29 said: Normally bedrock is unbreakable but the changed code allows to make bedrock breakable with some edited java code. Like This: Blocks.BEDROCK.setHardness(30.0F) Yes, I know you can do that. At least, in 1.12. That won't always be true (and in fact, in 1.13 you can't: hardness and resistance were made final). What I'm saying is that this function is called on bedrock: disableStats() This sets enableStats to false. enableStats is a protected field. There is no enableStatsAgain() method to set it back to true. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
June 6, 20196 yr I think I said something about that. On 5/25/2019 at 10:30 PM, Draco18s said: You can't. There's a function that sets stats off, but as it defaults to on, there's no method that turns the value back on. You could use reflection, but I don't know if that would be sufficient. Edited June 6, 20196 yr by Draco18s Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
June 6, 20196 yr 3 hours ago, Draco18s said: That won't always be true (and in fact, in 1.13 you can't: hardness and resistance were made final). Access Transformers exist. 25 minutes ago, Draco18s said: You could use reflection Or Access Transformers About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 6, 20196 yr Access Transformers are not better than Reflection. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
June 6, 20196 yr Author @Draco18s What is wrong with access transformers and how do I use a reflection? @Cadiboo what is an access transformer anyways.
June 6, 20196 yr 12 minutes ago, Draco18s said: Access Transformers are not better than Reflection. In some cases they are. They are better when you have a private/protected/package private Field that you want to get/set or you have a private/protected/package private Class that you want to access. They are also when you have a private Method that you want to call (not override). They are also the only solution (aside from ASM) to definalise a Class/Field/Method. In all other cases Reflection should be used About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 6, 20196 yr 3 hours ago, Cadiboo said: They are also the only solution (aside from ASM) to definalise a Class/Field/Method. This is not entirely true. https://stackoverflow.com/questions/3301635/change-private-static-final-field-using-java-reflection In fact I am pretty sure I saw similar code in forge at some point. Doing this is not a good idea though. 3 hours ago, Cadiboo said: In some cases they are. They are better when you have a private/protected/package private Field that you want to get/set or you have a private/protected/package private Class that you want to access. "In some cases they are better than reflection. That is in ALL of access cases." There is nothing wrong with using reflection and you should prefer reflection to ATs in most cases IMO. Use ATs if your reflective operation is too expensive(eg. called multiple times a frame).
June 6, 20196 yr 2 hours ago, V0idWa1k3r said: This is not entirely true. https://stackoverflow.com/questions/3301635/change-private-static-final-field-using-java-reflection In fact I am pretty sure I saw similar code in forge at some point. Doing this is not a good idea though. Java 9 removed the ability to definalise Fields with Reflection. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 6, 20196 yr 56 minutes ago, diesieben07 said: The other applicable point is when you need to override a final (or private, although this is dangerous) method, which literally cannot be achieved using reflection at all. Private instance methods cannot be overriden because the bytecode instructions in the class that uses it for them will still be INVOKE_SPECIAL rather than the INVOKE_VIRTUAL opcodes required for overriding to work. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 6, 20196 yr Author Yes, I glad it worked. I saw the removed apis and looks like https://www.oracle.com/technetwork/java/javase/9-removed-features-3745614.html does not say anything about reflection being removed.
June 6, 20196 yr I said that you can no longer definalise fields with Reflection (because of how it breaks the JVM) in Java 9. They definitely didn’t remove Reflection. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
June 7, 20196 yr I use it on my mod to replace the fluid renderer (the field in BlockRendererDispatcher is final) to add smooth lighting and other stuff. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.