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.

GotoLink

Members
  • Joined

  • Last visited

Everything posted by GotoLink

  1. Not 2, of course. You blasted out 3, so...1. Though you can do the same with AttackEntityEvent and attackTargetEntityWithCurrentItem . You don't need to copy anything by the way, reflection can Method# invoke (instance, params) even on protected methods (Method#setAccessible(true)).
  2. Use gradlew.bat build
  3. Well first there is the fact that EnderNetItemPage class is useless. It is only passing things to the TileEntity. You can implement the IInventory directly into the TileEntityEnderNetTerminal. Then, we have yet to see how you open the gui and container classes.
  4. In the package root folder. I'd say in "source", in this case. Though you can probably put it in another folder and link it as external files, depending on your IDE.
  5. Man are you serious ? You are binding the texture after rendering the item...
  6. GotoLink replied to RapidEv's topic in Modder Support
    public void func_110827_b(EntityMobTest entity, double par2, double par4, double par6, float par8, float par9) { super.doRenderLiving(entity, par2, par4, par6, par8, par9); } public void doRenderLiving(EntityLiving entity, double par2, double par4, double par6, float par8, float par9) { func_110827_b((EntityMobTest)entity, par2, par4, par6, par8, par9); } public void doRender(Entity entity, double par2, double par4, double par6, float par8, float par9) { func_110827_b((EntityMobTest)entity, par2, par4, par6, par8, par9); } Remove that.
  7. You can probably synchronize(chunk) { chunk.put(//stuff) } before putting stuff in it. That would get rid of duplicates.
  8. Yeah, this is the nice part of Gradle for us modders, looks at lot better than Ant script IMO And don't forget the automated forge updates. Ok, fixed Pahimar name I think IntelliJ can import Gradle projects if you point it the build.gradle file. You might have to change the run configuration on your own though.
  9. "Drops" is the key word. Search for DropsEvent
  10. This post is meant to help those not accustomed to building with Gradle, but wanting to use separate directories for making mods. (I think some people name it "Pahimar setup" or something...) As each setup can be different, I will take mine as a reference (the "Goto setup" ), and explain it as simply as possible. Before beginning This tutorial is meant to be IDE independent, and as such, use "conventional" naming of things and doesn't describe IDE settings step. Those you should know how to do, since you are supposed to choose your IDE while learning to code. For example, a "Project" is a group of resources, eventually with dependencies, that can be run. Eclipse uses this term, while IntellijIdea uses "Module". Not to be confused with IntellijIdea "Project" (which can be a group of projects) nor Gradle "Project", which are things that can be "built" through Gradle. I personally go with one "Project" = one mod = one Gradle "Project". (because Forge recommended it this way, and it makes sense too) The "dependency" setup This setup is based on dependencies, so build files are simplified and easier to change. My directories are as follows: -Forge (the folder inside which forge source has been extracted, per the main tutorial) \build.gradle \settings.gradle -Project1 (another folder, which contains the mod1) \build.gradle -Project2 (another folder, which contains the mod2) etc. Note the new file, settings.gradle, which only contain: includeFlat 'Project1','Project2' This basically specify that "Project1" and "Project2" folders depend on the Forge folder. For example you code a main core API in the Forge source, and dependent mods in the other folders. You can add more to the list. Specific subfolders can be added with line such as 'Project/subfolder'. You can make it a bit more intelligent with code for folder look-up, but this is outside of my post scope. build.gradle in Forge folder is a modified version of the file shipped with Forge sources: [spoiler=For 1.6.4] buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT' } } allprojects { apply plugin: 'forge' minecraft{version = "1.6.4-9.11.1.964"} version = "1.0" archivesBaseName = project.projectDir.name } [spoiler=For 1.7.2] buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" }maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' } } allprojects { apply plugin: 'forge' minecraft{version = "1.7.2-10.12.0.985"} version = "1.0" archivesBaseName = project.projectDir.name } It adds a body to "allprojects" with basic settings, such as applying forge, settings minecraft version and a general name for the mod jar. ( archivesBaseName ) This body applies parameters to all projects, including the Forge one. Use "subprojects" to work on all projects except the Forge one. Let see how it simplify the mod build.gradle, for example the Project1/build.gradle: version = "1.1" sourceSets.main{ java{ srcDirs project.projectDir.getPath() exclude ("bin/**", "build*") } resources{ srcDirs project.projectDir.getPath() exclude ("bin/**", "build*") } } processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace $version and $mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } The first body is made to set the mod source differently. With this, the "Project1" folder contains directly the source package, without "src/main/" intermediate folders, and making sure all superfluous files are excluded (here, a "bin" folder, and any file or folder whose name begin with "build"). Project1 \assets\modid1\textures\... \mods\modid1\... Of course, this entire file is optional and highly dependent on your own setup. Note that project.projectDir reference the folder as File, for easy copy-pasting in another mod folder. Now we can test the build with gradlew build by command line in Forge folder. Or with the Gradle plugin in Eclipse, open the gradle view and launch the "build" task for the Forge imported Gradle project. You should now have a simple jar into each Project/build/libs The "Independent" setup Again, you have multiple mods in separate folders, but don't want to use the Forge folder, nor do you want to build all mods at the same time. Indeed, you don't need to. Per the main tutorial, you made a Forge project, ran with either gradlew setupDevWorkspace or gradlew setupDecompWorkspace ForgeGradle and its dependencies should now be cached. Copy over the build.gradle file from the Forge folder in all your mods roots. (plus the gradle folder and gradlew files if you don't want to install Gradle) You can now delete the Forge project folder. With this project structure: Project2 \resources\assets\modid\textures\... \src\mods\modid\... \build.gradle A valid build.gradle file is: [spoiler=For 1.6.4] buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT' } } apply plugin: 'forge' minecraft{version = "1.6.4-9.11.1.964"} version = "1.0"//Set the mod version, is appended to the end of the jar name archivesBaseName = project.projectDir.name// Set the jar name as the project root folder name //Optional: change the project structure sourceSets.main{ java{ srcDirs 'src'//set the source folder as the /src subfolder } resources{ srcDirs 'resources'//set the resources folder as the /resources subfolder } } processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace $version and $mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } [spoiler=For 1.7.2] buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" }maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' } } apply plugin: 'forge' minecraft{version = "1.7.2-10.12.0.985"} version = "1.0"//Set the mod version, is appended to the end of the jar name archivesBaseName = project.projectDir.name// Set the jar name as the project root folder name //Optional: change the project structure sourceSets.main{ java{ srcDirs 'src'//set the source folder as the /src subfolder } resources{ srcDirs 'resources'//set the resources folder as the /resources subfolder } } processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace $version and $mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } You can now import the mod project in your favourite IDE , with the build.gradle file. You can also run gradlew build by command line in a project folder, to get the corresponding mod jar in its build/libs subfolder.
  11. You don't need to. It will be saved automatically
  12. You got it completely wrong. It is the opposite. It will never work on server if it is client side. Use a KeyHandler to send a packet to server side, then move items to the chest.
  13. WorldEvent.Load Then there is IConnectionHandler.
  14. Then you are going to need to check your magic numbers array "textureRefByID". Good luck.
  15. Use "Switch workspace" or restart Eclipse and select the old workspace.
  16. Obvious fail is obvious.
  17. You opened a new workspace.
  18. Lowercase the packages and the texture path.
  19. All biome decorators are deferred except for the End. Unless you override BiomeGenBase#getModdedBiomeDecorator(BiomeGenBase), or set another BiomeDecorator in your constructor, any custom biome decorator is deferred too. And BiomeDictionary.registerAllBiomesAndGenerateEvents() is called by ForgeDummyContainer. You probably failed to register to the terrain gen bus.
  20. ...Javadoc links are right next to the sources. http://files.minecraftforge.net/
  21. setFull3D() In the item constructor might do the trick.
  22. BiomeEvent.CreateDecorator is called on the Terrain_Gen_Bus, each time DeferredBiomeDecorator#decorate(World, Random, int, int) is called.
  23. Well, you need to look for events and interfaces. Is that hard ? [spoiler=Hint] events are classes that typically extend net.minecraftforge.event.Event interfaces are classes whose name typically start with I
  24. Move every initialization and registration into the FMLPreInit event. Blocks and Items included. And use lowercase for your package.

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.