DePhoegon Posted August 6, 2021 Share Posted August 6, 2021 (edited) GitHub - Axis Block GitHub - Slab Block What I can not figure out is 'why' the tooltips from the axiBlock (via Cut Sand Stones ) will not work, while the ones from directly & indirectly from Slab Block & GitHub - Energetic Slab. Also, for some reason, if the name for the Cut Sandstone & Cut Red Sandstone are anywhere close to it.. it seems to entirely confuse creative menu, and it seems to only have it's name if Doesn't start with cut (which I'm not entirely a fan of, as I would like them to have the same name.. but I am seeming to have problems with the RotatedPillarBlock in a way I'm not understanding. ---- I've worked to understand what's going on & even fuss through it, and rework logic (currently the major work was in the sand logic, expanding it to a class of 'energetic Slabs' to hold them up, and in such a way that it didn't matter lower, double, upper slab either. To expand design choices & limited the spider up through a energy sand [aka, color sand] -- would have just included the Override for MC sand (which worked, but had a nasty complication of 'world gen not including it, and not knowing how to replace the block correctly in the world gen. I would have replaced sand/red_sand in world with my versions, but I had also ran into complications around plants (cacti & dead bushes)... sooo that's a no go. =============================== *edit w10x64 Intellj Edited August 7, 2021 by DePhoegon System OS, & IDE in use Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 6, 2021 Share Posted August 6, 2021 do you know basic java? Quote Link to comment Share on other sites More sharing options...
DePhoegon Posted August 6, 2021 Author Share Posted August 6, 2021 41 minutes ago, Luis_ST said: do you know basic java? I'm just going to say, I don't get what you're going with that. --- Quote private static String tip0; private static String tip1; private static String tip2; --- This exists in the 'SandBlock', 'SlabBlock', & 'GenBlock' as well, and those ones function as intended. -- I don't get what's different, with this one. I'm partially sure I'm missing something obvious.. but I genuinely am being slightly bent out of shape about it. (mostly because it just doesn't seem to make sense to me as to the differences... and the only one I can figure out is that it's going through RotatedPillarBlock (built in class from the forge mdk of 1.17) [but that still goes back to the same block class as the others] Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 6, 2021 Share Posted August 6, 2021 do not use @OnlyIn, and learn what static mean in addition put never DeferredRegister and RegistryObjects in different classes Have you ever checked whether the methods are called the way you want them to? use Debbuger? and btw: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html 1 Quote Link to comment Share on other sites More sharing options...
DePhoegon Posted August 6, 2021 Author Share Posted August 6, 2021 12 hours ago, Luis_ST said: do not use @OnlyIn, and learn what static mean in addition put never DeferredRegister and RegistryObjects in different classes Have you ever checked whether the methods are called the way you want them to? use Debbuger? and btw: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html Have you even dug through the minecraft methods with the 1.17.1 (Forge) MDK? You're kinda coming off as if you ignored the question just to insult someone for how they wrote something down and don't understand what's actually going on. OnlyIn is actively used for Client side only behaviors, and has very legitimate server side applications as well. (as well as others, but I am not sure they are 'needed' or really able to use them for my purpose.) --- I really shouldn't need to tell you that attempting to capture the window for the Minecraft server will produce quite alot of problems. (which is exactly why I use it in getting the KB input) --- Further more.. The 'OnlyIn' that is in use is in | net.minecraftforge.api.distmarker | and isn't a native Java call in this context. Yes, Everything works.. With the exception of the ones from RotatedPillarBlock, and in such ways that it's not making sense. They work, and I'm more than open to being 'wrong' with how I do things, but I kinda know enough enough that 'while these methods are -weird-', they should work consistently with each other... and one working while another one doesn't is a sign something isn't setting right. _________________________ Taking the chance I likely defaulted to the wrong one without fully testing it[or under faulty logic] (using the IDE to suggest what it should be) [suggested final] Now what Bothers me .. is the inconsistent behavior, & this explains a tiny bit of what's going on with other seemingly ... weird MC behavior w/ text. -- Though honestly, What didn't make sense is that the sands, slabs, & general blocks worked (albeit with abnormal text for the subtext, for MC which didn't entirely seem right) but refused to work with the ones in the pillar blocks. Also, while I might be not understand what's 'acceptable' for MC in terms of 'Names', there might be issues at naming blocks too similarly to ones in the base game (Still testing) that out -- No seriously I think there might be somethin to this. Though really, you might not have been a self absorbed prick, and said something more along the lines of 'Are you sure you want to use 'static' in that String?' instead of coming off like someone who didn't read what was going on, and doesn't understand the point of the forum (Modding Minecraft w/ forge MDK) and attempting to say a method within that MDK shouldn't be touched, as if it was some forbidden Java code. Ya, I'm using a debugger... CONSTANTLY... build, test, dig through the logs/errors feed, and fixing what I see and am able to corrected & overlooked -- There is only so much an IDE can really do to 'guide'.. and Kinda why I asked if I was missing something or it was some bug because it Seemed to be working just fine for others & kicking back no errors either. -------- I also get the naming conventions, but I needed something that I could keep consistent & not step on my own damn'd toes ever 5 minutes. -- Ya, the conventions are their to help people keep aspects of the programing straight... not to be used as a tool for the anal to crack others on the head with. If you have a particular problem with how I did things, speak up or shove it. I'm more than willing to look at what I do and what others suggest might not be wise or not.. but shoving the equivalent of a book into my face without a singular word about 'what is what', is insulting, and utterly pointless. Quote Link to comment Share on other sites More sharing options...
diesieben07 Posted August 7, 2021 Share Posted August 7, 2021 11 hours ago, DePhoegon said: OnlyIn is actively used for Client side only behaviors, and has very legitimate server side applications as well. (as well as others, but I am not sure they are 'needed' or really able to use them for my purpose.) --- I really shouldn't need to tell you that attempting to capture the window for the Minecraft server will produce quite alot of problems. (which is exactly why I use it in getting the KB input) --- Further more.. The 'OnlyIn' that is in use is in | net.minecraftforge.api.distmarker | and isn't a native Java call in this context. Incorrect. OnlyIn is a marker annotation for vanilla code. Do not use it in your mod. In fact by calling out to the Minecraft class from appendHoverText you will crash servers. Whether you annotate those methods with @OnlyIn or not. And the fact that you think this would work, shows that you have no idea what @OnlyIn actually does. Do not use it. As for the tooltips not showing, I am not sure what you are referring to as they work just fine for me: Spoiler Please elaborate what your actual issue is and provide a way to reproduce it. Quote Link to comment Share on other sites More sharing options...
diesieben07 Posted August 7, 2021 Share Posted August 7, 2021 An addendum: Luis is correct in most of their statements. You should be following Java naming conventions. Putting DeferredRegister and its entries in separate classes is a bad idea. Your way to work around it with the empty register method to force static initialization is a terrible ugly hack. 1 Quote Link to comment Share on other sites More sharing options...
DePhoegon Posted August 7, 2021 Author Share Posted August 7, 2021 1 hour ago, diesieben07 said: Please elaborate what your actual issue is and provide a way to reproduce it. Replace 'final' with 'static' [in all the locations for the tooltips] -- Pretty sure this was the issue, but what I can't figure out is ... why it was so inconsistent & why it produces different text size/style (ignoring the MOTD slash colorcodes influences) == pretty sure my thought process was it was static per container & given I was able to actually get it to take a value before (with the sand_slabs) I don't think I get what's really going on in that set of interactions. ~~ my only idea, and this is a shot in the dark is that not all of the blocks/items called from it had the tooltips, so the null over wrote... or maybe it was the last item item to set all of them ... IDK... it just doesn't seem to click, and all I know is 'static' was just wrong to use that way and produced ....abnormal results w/ no obvious errors flagged or shown. It gets inconsistent, the tooltip (when it does show) Shares the same property of the Base item name. -- It's larger & overall disjointed compared to regular tooltips (even colorized ones) The one you are showing is the one using 'final' instead (and is how I expected it to look for the load of mods tooltips, in regards to how the font is displayed) ---------- I'm up for naming conventions & to keep a standardized understanding >.> Though atm, I admit it's not my first focus. -- I'll get onto making sure it all is flowing correctly after I get more of the logic worked out. Ok, Since the only place (OnlyIn) was used was in the keyboards capture. What would the solution actually be? Since I clearly didn't understand how it's intended to be used, or what it does / does not do. ---- ATM, working at figuring out how to get a 'Supplier<BlockState>' from a Blockstate. (For stairs) I'd rather not use a deprecated method.. again. (maybe I do need to rework out I do block registration for this.. IDK) Quote Link to comment Share on other sites More sharing options...
diesieben07 Posted August 7, 2021 Share Posted August 7, 2021 4 minutes ago, DePhoegon said: Replace 'final' with 'static' [in all the locations for the tooltips] -- Pretty sure this was the issue, but what I can't figure out is ... why it was so inconsistent & why it produces different text size/style (ignoring the MOTD slash colorcodes influences) == pretty sure my thought process was it was static per container & given I was able to actually get it to take a value before (with the sand_slabs) I don't think I get what's really going on in that set of interactions. Please learn what static means. This is basic Java knowledge. Yes, if you put static there all block instantiations will overwrite these fields and the last one wins. Not sure why would be inconsistent though, please elaborate what you mean on that. And no, it will not produce a different size or style, please also elaborate (screenshots?). 26 minutes ago, DePhoegon said: What would the solution actually be? https://mcforge.readthedocs.io/en/latest/concepts/sides/ 26 minutes ago, DePhoegon said: ATM, working at figuring out how to get a 'Supplier<BlockState>' from a Blockstate. (For stairs) I'd rather not use a deprecated method.. again. (maybe I do need to rework out I do block registration for this.. IDK) Again basic Java. A supplier is a functional interface. 1 Quote Link to comment Share on other sites More sharing options...
DePhoegon Posted August 7, 2021 Author Share Posted August 7, 2021 (edited) 59 minutes ago, diesieben07 said: Again basic Java. A supplier is a functional interface. ..... I'm not going to talk about it. >.> I genuinely do not fully get this | () -> | thing. Guess the Supplier<BlockState> got me mislead & 'functional Interface' didn't clue me in either. Any reading resources to help better understand that, It's never truly made sense to me. I only get nameless inline function. ============== Yes, I'm still new to java &.. I've been learning by taking the preassembled code apart & studying it, as I can.. and obviously I know I'm missing the finer parts.. but I'm not leaving those unforgotten either. ++++++++++++ As for what I thought I say.. hell if I bloody know now. The text is coming out the same. Perhaps I was just seeing things from stress or I don't understand what caused it to be visually larger & all capital when it did happen & can not reproduce it. Will keep an eye out, but bugger me sideways if I will find it again, knowingly. -- It went away when I switch to the final, and no idea what I did to cause or trigger it. Edited August 7, 2021 by DePhoegon *sigh* Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 7, 2021 Share Posted August 7, 2021 1 hour ago, DePhoegon said: I genuinely do not fully get this | () -> | thing. Guess the Supplier<BlockState> got me mislead & 'functional Interface' didn't clue me in either. this is a simple summary of functional interfaces, and how to use them, i hope this is helpful Quote Link to comment Share on other sites More sharing options...
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.