Issac29 Posted May 25, 2019 Posted May 25, 2019 (edited) 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, 2019 by Issac29 Quote
Draco18s Posted May 26, 2019 Posted May 26, 2019 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. Quote 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.
Issac29 Posted May 26, 2019 Author Posted May 26, 2019 (edited) 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, 2019 by Issac29 Forgot one Quote
Issac29 Posted June 5, 2019 Author Posted June 5, 2019 On 5/26/2019 at 3:30 AM, Draco18s said: And given that bedrock can't be broken by any means that would ever trigger stats, there's no point. Expand 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) Quote
Draco18s Posted June 5, 2019 Posted June 5, 2019 On 6/5/2019 at 9:45 PM, 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) Expand 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. Quote 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.
Draco18s Posted June 6, 2019 Posted June 6, 2019 (edited) I think I said something about that. On 5/26/2019 at 3:30 AM, 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. Expand You could use reflection, but I don't know if that would be sufficient. Edited June 6, 2019 by Draco18s Quote 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.
Cadiboo Posted June 6, 2019 Posted June 6, 2019 On 6/5/2019 at 9:58 PM, Draco18s said: That won't always be true (and in fact, in 1.13 you can't: hardness and resistance were made final). Expand Access Transformers exist. On 6/6/2019 at 1:18 AM, Draco18s said: You could use reflection Expand Or Access Transformers Quote About Me Reveal hidden contents 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)
Draco18s Posted June 6, 2019 Posted June 6, 2019 Access Transformers are not better than Reflection. Quote 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.
Issac29 Posted June 6, 2019 Author Posted June 6, 2019 @Draco18s What is wrong with access transformers and how do I use a reflection? @Cadiboo what is an access transformer anyways. Quote
Cadiboo Posted June 6, 2019 Posted June 6, 2019 On 6/6/2019 at 2:15 AM, Draco18s said: Access Transformers are not better than Reflection. Expand 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 Quote About Me Reveal hidden contents 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)
V0idWa1k3r Posted June 6, 2019 Posted June 6, 2019 On 6/6/2019 at 2:32 AM, Cadiboo said: They are also the only solution (aside from ASM) to definalise a Class/Field/Method. Expand 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. On 6/6/2019 at 2:32 AM, 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. Expand "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). Quote
Cadiboo Posted June 6, 2019 Posted June 6, 2019 On 6/6/2019 at 5:59 AM, 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. Expand Java 9 removed the ability to definalise Fields with Reflection. Quote About Me Reveal hidden contents 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)
Cadiboo Posted June 6, 2019 Posted June 6, 2019 On 6/6/2019 at 8:02 AM, 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. Expand 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. Quote About Me Reveal hidden contents 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)
Issac29 Posted June 6, 2019 Author Posted June 6, 2019 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. Quote
Cadiboo Posted June 6, 2019 Posted June 6, 2019 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. Quote About Me Reveal hidden contents 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)
Issac29 Posted June 7, 2019 Author Posted June 7, 2019 And by how definalize fields could be useful. Quote
Cadiboo Posted June 7, 2019 Posted June 7, 2019 I use it on my mod to replace the fluid renderer (the field in BlockRendererDispatcher is final) to add smooth lighting and other stuff. Quote About Me Reveal hidden contents 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)
Issac29 Posted August 13, 2019 Author Posted August 13, 2019 Well this topic is solved so thank you. Quote
Recommended Posts
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.