-
Posts
588 -
Joined
-
Last visited
Everything posted by shadowfacts
-
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 } } }
-
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.
-
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
shadowfacts replied to frenchtoaster10's topic in Modder Support
MovingObjectPosition mop = player.rayTrace(distance, partialTickTime); mop.blockX/Y/Z; -
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.
-
TheGreyGhost has a really good blog post explaining how lighting works in Minecraft.
-
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?
shadowfacts replied to jokekid's topic in Modder Support
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
shadowfacts replied to LordMastodon's topic in Modder Support
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 -
#minecraftforge on EsperNet Web chat
-
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
shadowfacts replied to LordMastodon's topic in Modder Support
I've created a pull request explaining what your problem was. -
[1.8 (Does it really matter?)] Checking for available updates
shadowfacts replied to LordMastodon's topic in Modder Support
What is the URL of your GitHub repo? -
[1.8 (Does it really matter?)] Checking for available updates
shadowfacts replied to LordMastodon's topic in Modder Support
By "buildscript" do you mean the build.gradle file or the Drone build script? -
[1.8 (Does it really matter?)] Checking for available updates
shadowfacts replied to LordMastodon's topic in Modder Support
Just add the task to the end of your build.gradle file -
[1.8 (Does it really matter?)] Checking for available updates
shadowfacts replied to LordMastodon's topic in Modder Support
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 -
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
shadowfacts replied to LordMastodon's topic in Modder Support
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. -
To hide items or blocks from GUIs like the NEI or SFM ones, you have to use their Respective APIs to blacklist it.
-
It's not package.info but package-info.java.
-
Try running gradlew cleanEclipse eclipse to regenerate the Eclipse configuration files.