Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi all,

a user asked me, if I could port my mod back to 1.11.2 and 1.10.2. That's not the problem at all, I've more a problem to use conditionals to have an easy to use code afterwards without losing any functionality.

As far as I know maven solves the topic conditionals by using different profiles which are used to include different files.

So if I'm right let us take the following function:

FMLCommonHandler.instance().getMinecraftServerInstance().getWorld( id ); //in 1.12.2
FMLCommonHandler.instance().getMinecraftServerInstance().worlds[ id ]; //in 1.11.2
FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[ id ]; //in 1.10.2

 

Now I need to put them into a method like public static WorldServer getServer( int id ) and this one into separated files like:

example.utils.getWorldServer.1-12-2.java;
example.utils.getWorldServer.1-11-2.java;
example.utils.getWorldServer.1-10-2.java;

 

To use them I need to include the entire namespace with import example.utils.getWorldServer.*;

 

The last step would be to create a xml file handling the profiles which java file should be included, where I got stucked.

 

I mean shouldn't it be possible through gradle too? Like:

if ( project.minecraft.version.equals("1.12.2") )
// include file 1-12-2.java
else if ( project.minecraft.version.equals("1.11.2") )
// include file 1-11-2.java
else if ( project.minecraft.version.equals("1.10.2") )
// include file 1-10-2.java

 

If you have any other more sophisticated ideas to solve this topic I will appreciate it.

 

Kind regards,

Pixtar

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.