Awsome Posted August 27, 2020 Posted August 27, 2020 So in my custom FeatureConfig class, I'm putting a list of BlockStates into the datafixer in the serialize() method. I would like to know if the unchecked cast warnings on lines 42 and 46 are unavoidable. I have a feeling that they are unavoidable since I need to cast to a generic type. I've looked online to see if the cast on those lines are unavoidable, but I didn't find anything helpful for my situation. I try to avoid writing code that gives warnings at all costs. Asking here because I couldn't find anything elsewhere. Any help would be greatly appreciated. Source: https://github.com/Awsomekeldeo/RealisTech/blob/b315e0472aedc4bb4d8f999e9d6984e126edddb1/src/main/java/awsome/realistech/worldgen/feature/ClayDepositConfig.java#L42 Quote
vemerion Posted August 28, 2020 Posted August 28, 2020 As far as I know, there is no way to fix this, except to make changed to the interface, which is obviously not possible in this case. Therefore your best bet is unfortunately to use the SuppressWarnings annotation. 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.