Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • ForgeGradle
  • How do you use gradle to build mods (having used advanced initial setup)?
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
Feldherren

How do you use gradle to build mods (having used advanced initial setup)?

By Feldherren, June 21, 2014 in ForgeGradle

  • Reply to this topic
  • Start new topic

Recommended Posts

Feldherren    0

Feldherren

Feldherren    0

  • Tree Puncher
  • Feldherren
  • Members
  • 0
  • 13 posts
Posted June 21, 2014

The instructions for using gradle to compile mods in the tutorial only seems to be applicable when the basic setup process was used; having used the advanced initial setup (it was recommended by the first tutorial I found for setting up Forge for development with Eclipse, so I initially went with that), I ended up creating my mod in another package. However, I've noticed that the given steps for using gradle to compile this mod don't work for items in other projects. What do I need to do to compile my mod in another project than the default Forge one?

 

Or do I need to somehow finagle the package for my mod from the other project to the Forge one?

 

I'm new to Forge, having previously used Bukkit - and I'm rusty with both that and Eclipse due to not having used either for quite a while. Sorry if any of this sounds stupid.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45601 posts
Posted June 22, 2014

What is the "advanced initial setup"?

  • Quote

Share this post


Link to post
Share on other sites

Feldherren    0

Feldherren

Feldherren    0

  • Tree Puncher
  • Feldherren
  • Members
  • 0
  • 13 posts
Posted June 22, 2014

It's described here: http://www.minecraftforge.net/forum/index.php/topic,14048.0.html

(Also at http://bedrockminer.jimdo.com/modding-tutorials-1-7/set-up-minecraft-forge/set-up-minecraft-forge-advanced-setup/ , which is why I ended up using it in the first place.)

Basically, creating a new workspace and importing Forge into it, rather than putting your workspace in the Eclipse directory in the Forge directory. I think.

 

I've successfully written and run something already with this setup, so it's not that it doesn't work at all, but the steps for compiling a mod only seem to cover projects using the normal setup.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45601 posts
Posted June 22, 2014

Why? Why why why?

This is unnecessary and only causes problems. Do not do this.

 

Edit: The two tutorials you linked describe different things! The one on this forum is just fine.

Edit2: I am not sure if I understand things correctly. Your source code is at src/main/java right? Next to the build.gradle? If so, gradlew build will work just fine.

  • Quote

Share this post


Link to post
Share on other sites

Feldherren    0

Feldherren

Feldherren    0

  • Tree Puncher
  • Feldherren
  • Members
  • 0
  • 13 posts
Posted June 22, 2014

Okay, I think I see where they differ. I was going to ask if you could tell me where, but I do see it, now. Thanks.

 

My code was elsewhere, and I recognised that was why gradle wasn't working. I was wondering if there was a way around that, but going by what you said that was a symptom of another problem.

Now I just need to work out why my code isn't working having been copied over from the original location, where it did work.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • matt1999rd
      [1.14-newer] how to keep value when closing minecraft

      By matt1999rd · Posted 2 minutes ago

      it works well with Capability thanks
    • DaemonUmbra
      My Forge 1.12 and 1.12.2 Keep Crashing when i start it up

      By DaemonUmbra · Posted 15 minutes ago

      Any particular reason you're running 1.12 instead of 1.12.2?
    • Simon_kungen
      [1.14.4] TileEntityItemStackSpecialRenderer (TEISR)

      By Simon_kungen · Posted 19 minutes ago

      Hi   I got this item that stores a single stack of something else, and a glass variant of it should render the stack inside, but according to the docs I just need to set the renderer on the item and it should work but as far as I can see nothing happens, not even the console prints anything:   ItemSingleStackGlassContainer.java public class ItemSingleStackGlassContainer extends ItemSingleStackContainer { public ItemSingleStackGlassContainer(String name, float isolation, int tint) { super(new Item.Properties().setTEISR(() -> SingleStackGlassContainerItemRender::new),name,isolation,tint); } ... }   The superclass: ItemSingleStackContainer.java public class ItemSingleStackContainer extends Item { public static final ResourceLocation open = new ResourceLocation(Reference.MODID,"open"); private final float isolation; private final int tint; private static short failedToOpen = 0; private boolean isOpen = false; public ItemSingleStackContainer(Item.Properties properties,String name, float isolation, int tint) { super(properties.maxStackSize(1).group(ItemGroup.TOOLS)); if (isolation < 0 || isolation > 1) throw new IllegalArgumentException("Can only be between 0 and 1!"); addPropertyOverride(open,(itemStack, worldIn, entityLivingBase) -> isOpen ? 1 : 0); this.isolation = isolation; this.tint = tint; setRegistryName(name); } public static ItemStack getContainedItemStack(ItemStack stack) { IItemHandler handler = stack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElseThrow(NullPointerException::new); return handler.getStackInSlot(0); } ... }   The renderer that should just render the stack somewhere visible on the camera for now and print out to the console: SingleStackGlassContainerItemRender.java @OnlyIn(Dist.CLIENT) public class SingleStackGlassContainerItemRender extends ItemStackTileEntityRenderer { @Override public void renderByItem(ItemStack itemStackIn) { System.out.println("Rendering it I guess."); // Doesn't get printed out to the console. if (itemStackIn.getItem() instanceof ItemSingleStackGlassContainer) { ItemStack itemStack = ItemSingleStackContainer.getContainedItemStack(itemStackIn); if (itemStack != ItemStack.EMPTY) { GlStateManager.pushMatrix(); Minecraft.getInstance().getItemRenderer().renderItem(itemStack, ItemCameraTransforms.TransformType.FIXED); GlStateManager.popMatrix(); } } } }  
    • Rohman
      [1.12.2 Build 2847] Server Crash on startup

      By Rohman · Posted 19 minutes ago

      Well aren't I the stupid idiot! Much appreciated for your time! ❤️
    • DaemonUmbra
      [1.12.2 Build 2847] Server Crash on startup

      By DaemonUmbra · Posted 41 minutes ago

      You are missing a mod that LittleTiles depends on, please re-read the mod’s CurseForge page
  • Topics

    • matt1999rd
      5
      [1.14-newer] how to keep value when closing minecraft

      By matt1999rd
      Started 21 hours ago

    • Kuaka
      1
      My Forge 1.12 and 1.12.2 Keep Crashing when i start it up

      By Kuaka
      Started 2 hours ago

    • Simon_kungen
      0
      [1.14.4] TileEntityItemStackSpecialRenderer (TEISR)

      By Simon_kungen
      Started 19 minutes ago

    • Rohman
      4
      [1.12.2 Build 2847] Server Crash on startup

      By Rohman
      Started 3 hours ago

    • JetCobblestone
      12
      [1.14] moving item assignment to a separate function

      By JetCobblestone
      Started 21 hours ago

  • Who's Online (See full list)

    • Skydev
    • matt1999rd
    • Simon_kungen
    • fcelon
    • JetCobblestone
    • DaemonUmbra
    • SapphireSky
    • cookiedragon234
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • ForgeGradle
  • How do you use gradle to build mods (having used advanced initial setup)?
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community