Posted April 19, 201510 yr Yes, yes, I know this "if you don't know what are you doing, don't do it" and "you shouldn't use it" arguments. But I am simply experimenting with classLoaders. Common Proxy (when you launch server): public void initNetwork() { try { theNetwork = ServerNetwork.class.newInstance(); } catch (Exception e) { RoAMain.log.log(Level.FATAL, "Could not initialize server network! A lot of errors can be expected."); } } ClientProxy (for clients): @Override public void initNetwork() { theNetwork = new ClientNetwork(); } theNetwork is AbstractNetwork ServerNetwork extends AbstractNetwork is @SideOnly(Side.SERVER) ClientNetwork extends AbstractNetwork is @SideOnly(Side.CLIENT) Question is quite simple: Is what I done above (#newInstance()) only way of avoiding NoClassDefFound? Obviously when you use theNetwork = new ServerNetwork(); It will crash, and above is only thing I could think of. Reflection is evil in my case (above is not it, above is an example). Thanks. EDIT Oh and before someone asks - the @SideOnly is not used because I want it to be there, it is there because I want to simulate classes not being there in my dev env (because they are not there in real-life). 1.7.10 is no longer supported by forge, you are on your own.
April 19, 201510 yr Author Reflection is evil in my case (above is not it, above is an example). Network might have been bad naming here. Even if network would be the actual network, it wouldn't matter - integrated server won't even use what I am doing (it's being developed as dedicated server feature - server sends and makes client load classes, don't ask , and yes, it's secured). EDIT Basically - is there a way to make instance of class that is @SideOnly without reflection? 1.7.10 is no longer supported by forge, you are on your own.
April 19, 201510 yr Author How could I not think of this Thanks m8, as always. 1.7.10 is no longer supported by forge, you are on your own.
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.