Everything posted by shadowfacts
-
[1.7.10] Looping Item Subtypes
public static YourItem extends Item { public static Class<? extends Entity>[] entityClasses = new Class<? extends Entity>[11]; // the Class is the entity to summon and the index in the array is the metadata it should be used for // insert here: populate the list public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int meta, float f1, float f2, float f3) { if (player.canPlayerEdit(x, y, z, meta, stack) && !world.isRemote) { Entity e = entityClasses[meta].getConstructor(World.class).newInstance(world); // set any other entity properties // spawn entity // catch various potential reflection exceptions } } }
-
[1.7.10] Attempting to create a machine
TGG's example is for 1.8. The code is meant to be an example and explanation of how things work, not something you can or should just copy and paste into your mod. If you've rewritten the code and are having problems, post the errors and the code itself, otherwise we cannot help.
- [1.7.10] Shaders
-
How to make the player render upside-down
What do you mean "I can't use gl and there's no method for it"? You should be able to use it just fine: @SubscribeEvent public void preRenderPlayer(RenderPlayerEvent.Pre event) { GL11.glRotatef(insert, your, args, here); }
-
[1.8] [SOLVED] get pos of block player is looking at
MovingObjectPosition mop = player.rayTrace(distance, partialTickTime); mop.blockX/Y/Z;
-
[1.8] Light
Colored lights requires a huge amount of hacky shit, just because that's not how the engine was originally built. If you are really intent on doing colored lighting, there is a mod[/url[ which adds this and has an API that you can use.
-
[1.8] Light
TheGreyGhost has a really good blog post explaining how lighting works in Minecraft.
-
[1.8] FMLLog Shenanigans
You don't need to use FMLLog, you can just get a Logger straight from Log4j. public static final Logger logger = LogManager.getLogger(ModConstants.MOD_NAME);
-
[gitHub]How do i submit a WIP mod to github?
You'll want to create a file in your project directory called .gitignore (yes, with the . in front). This tells Git which files to not to track. This is an example of the .gitignore file that I'm using for one of my projects. After that it's exactly same for create a repo, committing, and pushing as any other Git repository.
-
[1.8 (Does it really matter?)] Checking for available updates
1. It sounds good 2. Shameless self promotion, a while ago I wrote a bunch of code to parse/match/work with semantic versions, it's on GitHub, feel free to use the lib
-
IRC Channel
#minecraftforge on EsperNet Web chat
-
[1.7.10] Crafting result based on NBT
You need to determine the result of the recipe in getCraftingResult, where you actually have access to the stacks being used, not just a dummy one
-
[1.8 (Does it really matter?)] Checking for available updates
I've created a pull request explaining what your problem was.
-
[1.8 (Does it really matter?)] Checking for available updates
What is the URL of your GitHub repo?
-
[1.8 (Does it really matter?)] Checking for available updates
By "buildscript" do you mean the build.gradle file or the Drone build script?
-
[1.8 (Does it really matter?)] Checking for available updates
Just add the task to the end of your build.gradle file
-
[1.8 (Does it really matter?)] Checking for available updates
To automatically output the version to a txt file, you can create a custom task like so: task version() { File f = new File("$buildDir/libs/version.txt") if (!f.getParentFile().exists()) f.getParentFile().mkdirs() if (!f.exists()) f.createNewFile() FileOutputStream fos = new FileOutputStream(f) fos.write(project.version.getBytes()) fos.close() } Drone: (note, this assumes your mod is open source and hosted on GitHub) 1. Go to drone.io 2. Login with GitHub 3. Create a new GitHub project with your repository 4. Select Java as the project language 5. Replace the default buildscript with: chmod +x gradlew ./gradlew setupCIWorkspace build version 6. Open the artifacts tab and to the list add: build/libs/*.jar build/libs/version.txt 7. Press Save 8. Build your project 9. Use the aforementioned code to download the contents of your version.txt from this url: https://drone.io/github.com/{username}/{RepoName}/files/build/libs/version.txt
-
[1.8][off topic] how do you put a mod in pages like 9minecraft or minecrafteo
Said webmaster(s) shouldn't. They are illegally redistributing other's work, and sometimes claiming credit for it. If one or more of your mods ends up on one of these sites, you should immediately have them take it down.
-
Not finding NullPointer
The NullPointerException you're seeing is happening when Minecraft attempts to generate a crash report and is not related to your problem. If you'd look farther up in the log, you would've seen this: Specifically, this: The mcmod.info file in TerrariaCraft cannot be parsed as valid JSON. Run your mcmod.info file through a JSON validator. This will tell you what is wrong with your JSON.[/code]
-
[1.8 (Does it really matter?)] Checking for available updates
You've basically reinvented SemVer. While it would be amazing if all mods followed something even resembling SemVer (e.g. MCVERSION-MAJOR.MINOR.PATCH), it's never going to happen. To get text from the internet is extremely easy using Apache Commons IO which is already a dependency of Minecraft/Forge: String s; InputStream in = new URL( "http://jakarta.apache.org" ).openStream(); try { s = IOUtils.toString(in); } finally { IOUtils.closeQuietly(in); } You won't be able to use Jenkins for CI unless you already have a server. My personal suggestion if you don't is to use Drone, a fairly good, and free, CI server.
-
how not to include a class into the resulting jar when building with gradle?
Gradle is based on Groovy which runs on the JVM, so anything you can do in Java you can do in Groovy.
-
how not to include a class into the resulting jar when building with gradle?
You can use compileJava { exclude 'com/mymod/test/*.java }
-
[1.7.10] Create hidden items/blocks?
To hide items or blocks from GUIs like the NEI or SFM ones, you have to use their Respective APIs to blacklist it.
-
How to make API for mod?
It's not package.info but package-info.java.
-
Workspace problems :(
Try running gradlew cleanEclipse eclipse to regenerate the Eclipse configuration files.
IPS spam blocked by CleanTalk.