Everything posted by DiabolusNeil
-
Implementing Config File Crash the Game
No, he's saying that you need to load the configuration file, then register the items. You're doing it the other way around.
-
[1.6.4] [RESOLVED] How to access inventory with an item
All I know about accessing inventories is right-clicking on a block and it creating a new tile entity. How would I do this with an item?
-
Getting started for modding, 965/164
Modding for 1.6.4 doesn't use the ForgeGradle system. Anyways, for good tutorials, check out Vswe's series.
-
Null exception[solved]\ Missing block[Needs solving]
The report says what the error is, you're trying to call part of an array that doesn't exist. Plus, since I don't see any code, we can't help you.
-
[1.6.4] Fingerprint System
I've heard of it, but I don't quite know what it is and how to use it. Could someone enlighten me on the subject?
-
[1.6.4] RESOLVED How to get the running Minecraft directory
Thanks!
-
[1.6.4] RESOLVED How to get the running Minecraft directory
Title explains it. I want to get the path of the Minecraft directory the client is currently running on. I've looked into a few of the Forge classes, but I couldn't find anything.
-
JSON or XML file that stores all forge releases
I don't think there is. You may have to create your own.
-
Enchantment effect on bow.
public boolean hasEffect() { return true; }
-
[1.7.2] Adding Tooltip to custom block
I haven't messed around with 1.7 yet, but I suggest giving the block it's own ItemBlock, and using the addInformation() method to that.
-
Where is the ore generator?
Here's an example pulled from my mod. import java.util.Random; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; public class WorldGenHandler implements IWorldGenerator { public WorldGenerator myCustomOre; public WorldGenHandler() { GameRegistry.registerWorldGenerator(this); myCustomOre = new WorldGenMinable(2048, 7); // 2048 = Block Id, 7 = Maximum number of ores per cluster } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { generateOre(random, chunkX, chunkZ, world, 8, myCustomOre, 0, 63); // 8 = Number of clusters it tries to generate per chunk } private void generateOre(Random rand, int chunkX, int chunkZ, World world, int iterations, WorldGenerator gen, int lowestY, int highestY) { for (int i = 0; i < iterations; i++) { int x = chunkX * 16; int y = rand.nextInt(highestY - lowestY) + lowestY; int z = chunkZ * 16; gen.generate(world, rand, x, y, z); } } } And inside your mod class, make a new WorldGenHandler object. @EventHandler public void init(FMLInitializationEvent event) { new WorldGenHandler(); } Make sure to import everything correctly. (Eclipse: CTRL+SHIFT+O (Mac: SHIFT+CMD+O))
-
Crash report help
No code, no help.
-
[1.6.4] Detecting player's item's enchantments
Thanks Draco, but I actually just figured out how to get the enchantments. This is what I used to test. ItemStack item = player.inventory.getCurrentItem(); if (item != null) { NBTTagList enchants = item.stackTagCompound.getTagList("ench"); boolean hasSilkTouch = false; for (int i = 0; i < enchants.tagCount(); i++) { if (((NBTTagCompound) enchants.tagAt(i)).getShort("id") == 33) { hasSilkTouch = true; break; } } System.out.println(hasSilkTouch); } I looked at the Enchanted Book code.
-
[1.6.4] Detecting player's item's enchantments
Thanks for the advice, but I still don't know how to get the enchantments of an item.
-
[1.6.4] Detecting player's item's enchantments
Hello. I've tried experimenting with this for a while, and what I'm trying to do doesn't work. private static ItemStack currentItem = FMLClientHandler.instance().getClient().thePlayer.inventory.getCurrentItem(); public static boolean doesPlayerHaveSilkTouch = currentItem != null && currentItem.isItemEnchanted() && currentItem.getEnchantmentTagList().getId() == 33; I print to the console this in my onBlockDestroyedByPlayer() method, and it results to false, even if my item does have Silk Touch on it. Is there a better way to detect enchantments?
-
[1.6.4] How to make an entity follow the player?
Check out the wolf code.
-
[1.6.4] RESOLVED Java.lang.OutOfMemoryError after registering a custom block
I'm facedesking myself right now. I didn't have a proper ID for the Gold-Emerald ore. Now everything works. Everyone makes mistakes, I guess.
-
[1.6.4] RESOLVED Java.lang.OutOfMemoryError after registering a custom block
I did call the code. It just randomly stopped working. I'll explain a bit more: I was registering blocks, same as always, it was working perfectly fine. I added two more blocks, I then started to get the error. I then commented out the lines of code where I registered the two new blocks. Same thing happens. It might be my system. I'll test later.
-
[1.6.4] RESOLVED Java.lang.OutOfMemoryError after registering a custom block
I already stated that I was doing the old method earlier, and didn't have any problems. Now when I try and do the exact same thing that I was doing hours ago, I get that error. Look at the coding timelapse, you'll see.
-
[1.6.4] RESOLVED Java.lang.OutOfMemoryError after registering a custom block
Okay then. Here's the code registering the blocks, which is being called in the mod class. The code inside BlockCompoundOre. Code from BlockIronCoalOre
-
[1.6.4] RESOLVED Java.lang.OutOfMemoryError after registering a custom block
This is starting to get really annoying. I'm working on my mod which adds custom blocks, and after launching the game for about the 100th time, every time I try and enter a world (new or old) I keep getting this error message. The error message ends after that. I'm just trying to do a normal GameRegistery.registerBlock(), I'm using a Mac OSX 1.6.8, Eclipse SDK with Java 6 for the decompiler, and Forge 9.11.1.965. Commenting out the register method ends up in Minecraft launching just fine. If you need me to post the code, I will do so. I actually did a coding timelapse a few hours before I had this issue arise. I will post it so you can see that I wasn't having this problem earlier: http://www.youtube.com/watch?v=35FQ9a_QADA
-
[Help!] How to make a block spawn another block
Try using the onUpdate() method.
-
[1.6.4] Making a custom container block
Something like a custom furnace, which I could expand upon. The only updated tutorial I could find was ScratchForFun's videos, but he presents the tutorials so slowly and poorly, to the point that the series is almost unwatchable. Is there any other tutorial for this?
-
[1.6.4]Crashing but only on server with getIcon (arrayindexoutofbounds)
"Goes to Minecraft Forge Forums for help with crashing mod, doesn't read crash report, problem was a common Java error that can be fixed in 5 seconds."
-
[1.6.4]How can I add a custom inventory GUI?
I don't think he knows how to actually make a GUI.
IPS spam blocked by CleanTalk.