Everything posted by GotoLink
-
[solved] Causing a different type of DamageSource when entity is hit
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)).
-
Packed jar fails to reobsucate
Use gradlew.bat build
-
Disappearing Container Items
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.
-
can't find out why it isnt loading my texture.
Fixed that for you
-
Where do i put assets file?
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.
-
ItemRender doesn't work.
Man are you serious ? You are binding the texture after rendering the item...
-
White Mob
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.
-
Weird bug that I can't figure out
You can probably synchronize(chunk) { chunk.put(//stuff) } before putting stuff in it. That would get rid of duplicates.
-
[How-To]Build multiple separate projects with Gradle
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.
-
Mob and Block question[SOLVED]
"Drops" is the key word. Search for DropsEvent
-
[How-To]Build multiple separate projects with Gradle
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.
-
Saving persistent global data
You don't need to. It will be saved automatically
-
Moving items from player to chest
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.
-
Function that Runs on World Startup
WorldEvent.Load Then there is IConnectionHandler.
-
Textures work in eclipse, but not the real game?
Then you are going to need to check your magic numbers array "textureRefByID". Good luck.
-
Can't find 'minecraft' tab in eclipse
Use "Switch workspace" or restart Eclipse and select the old workspace.
-
Ore not Spawn in the NETHER
Obvious fail is obvious.
-
Can't find 'minecraft' tab in eclipse
You opened a new workspace.
-
Textures work in eclipse, but not the real game?
Lowercase the packages and the texture path.
-
Biome Registration Event?
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.
-
Documentation for modders?
...Javadoc links are right next to the sources. http://files.minecraftforge.net/
-
Item Rendering
setFull3D() In the item constructor might do the trick.
-
Biome Registration Event?
BiomeEvent.CreateDecorator is called on the Terrain_Gen_Bus, each time DeferredBiomeDecorator#decorate(World, Random, int, int) is called.
-
1.6.2 (Custom Energy Like Buildcraft/IC2/Thermal Expansion)
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
-
Item Recipes not working in multiplayer?
Move every initialization and registration into the FMLPreInit event. Blocks and Items included. And use lowercase for your package.
IPS spam blocked by CleanTalk.