So then, and i know this question is going to seem really dumb, but once you have all your files coded in eclipse... where are they even supposed to go, saved, so that when you test run it, it actually uses the files and pays attention to them? I can't find anywhere that says where the mod files are supposed to go, or how (in a separate folder in the mc folder?)... I can't even get a dirt makes paper recipe to work. Nothing is showing up when i test it or recompile it.
When I make a custom wire the texture doesn't seem to want to show up when I place it, just the default purple square on the ground. Has anyone else had this problem?
Btw, yes I do know how to use ITextureProvider and all. Do I have to do anything different?
can i see your code
it's probably just a easy mistake
BlockLSGreenstoneWire
package net.minecraft.src;
import java.util.Random;
import net.minecraft.src.forge.*;
public class BlockLSGreenstoneWire extends BlockRedstoneWire implements ITextureProvider
{
public BlockLSGreenstoneWire(int par1, int par2)
{
super(par1, par2);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return LSModItems.greenstone.shiftedIndex;
}
public boolean canConnectRedstone(IBlockAccess iba, int i, int j, int k, int dir)
{
return true;
}
@Override
public String getTextureFile() {
return "/Mic'sMods/LightSaberMod/blocks/blocks.png";
}
}
LSModBlocks
package net.minecraft.src;
public class LSModBlocks {
public static Block greenstoneWire;
public LSModBlocks() {
greenstoneWire = (new BlockLSGreenstoneWire(195, 12)).setHardness(0.0F).setStepSound(Block.soundPowderFootstep).setBlockName("greenstoneDust").disableStats().setRequiresSelfNotify();
registerBlocks(new Block[] { greenstoneWire });
ModLoader.addName(greenstoneWire, "Greenstone Wire");
}
public void registerBlocks(Block ablock[])
{
Block ablock1[] = ablock;
int i = ablock1.length;
for(int j = 0; j < i; j++)
{
Block block = ablock1[j];
ModLoader.registerBlock(block);
}
}
}
mod_LSMod
package net.minecraft.src;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*;
import java.util.logging.Logger;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import org.lwjgl.input.Mouse;
import net.minecraft.client.Minecraft;
import net.minecraft.src.forge.*;
public class mod_LSMod extends NetworkMod {
private boolean addBlocks;
public mod_LSMod()
{
}
@Override
public String getVersion() {
return "1.2.5 v0.9";
}
@Override
public boolean clientSideRequired()
{
return true;
}
@Override
public boolean serverSideRequired()
{
return false;
}
@Override
public void load() {
new LSModItems();
new LSModBlocks();
MinecraftForgeClient.preloadTexture("/Mic'sMods/LightSaberMod/icons/items.png");
MinecraftForgeClient.preloadTexture("/Mic'sMods/LightSaberMod/blocks/blocks.png");
}
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen screen){
if (screen instanceof GuiContainerCreative){
if(addBlocks == false){
Container container = ((GuiContainer)screen).inventorySlots;
List list = ((ContainerCreative)container).itemList;
list.add(new ItemStack(LSModBlocks.greenstoneWire));
}
addBlocks = true;
}
return true;
}
}
everything works fine, when i recompile and use startclient, the textures work. but then when i reobfuscate, put the textures folder inside the .zip, and put that in the /mods/ folder, it doesn't register the textures?
Rollback Post to RevisionRollBack
Freakin' useful mod (I only use it for SSP!)
I like to play FTB with some additions. Also custom modsets are awesome!
Can somebody help me with the infinite item sprites? I have it set up exactly as in the tutorial (see code) for my blocks and tools, but for some reason when i set the icon index for my item, it loads the default "items.png", even though the item is supposed to load /EnderMod/gui/items.png, so my item looks like seeds instead of its texture (the index is 9 for both). Everything works for my other blocks, tools, and armor, but for some reason it doesnt work for just plain items. Here's the code for one of the items, and one of the blocks just for comparison.
mod_EnderFamily.java
package net.minecraft.src;
import net.minecraft.src.forge.*;
import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_EnderFamily extends BaseMod{
public static final Item EnderScale = new Item(142).setIconIndex(9).setItemName("thth");
public static final Block EnderBlock = new BlockEnderBlock(131, 1).setHardness(0.1F).setResistance(0.0F).setLightValue(1.0F).setBlockName("asdg");
public mod_EnderFamily()
{
ModLoader.registerBlock(EnderBlock);
}
public void load()
{
MinecraftForgeClient.preloadTexture("/EnderMod/gui/items.png");
MinecraftForgeClient.preloadTexture("/EnderMod/terrain.png");
ModLoader.addName(EnderScale, "Ender Scale");
ModLoader.addName(EnderBlock, "Block Of Ender");
}
public String getVersion()
{
return "1.0";
}}
ItemEnderScale.java
package net.minecraft.src;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.src.forge.*;
public class ItemEnderScale extends Item implements ITextureProvider
{
public ItemEnderScale(int i)
{
super(i);
}
public String getTextureFile()
{
return "/EnderMod/gui/items.png";
}
}
BlockEnderBlock.java
package net.minecraft.src;
import net.minecraft.src.forge.*;
public class BlockEnderBlock extends Block implements ITextureProvider
{
public BlockEnderBlock(int i, int j)
{
super(i, j, Material.rock);
}
public String getTextureFile()
{
return "/EnderMod/terrain.png";
}
}
Sorry to bother but I'm having a problem that when I try to test my mod in eclipse it says this:
27 achievements
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.minecraft.src.StatList.initCraftableStats(StatList.java:130)
at net.minecraft.src.StatList.initBreakableStats(StatList.java:105)
at net.minecraft.src.Block.<clinit>(Block.java:1360)
at net.minecraft.src.TextureWaterFX.<init>(TextureWaterFX.java:13)
at net.minecraft.client.Minecraft.<init>(Minecraft.java:293)
at net.minecraft.src.MinecraftImpl.<init>(MinecraftImpl.java:14)
at net.minecraft.client.Minecraft.startMainThread(Minecraft.java:2446)
at net.minecraft.client.Minecraft.startMainThread1(Minecraft.java:2432)
at net.minecraft.client.Minecraft.main(Minecraft.java:2504)
at Start.main(Start.java:22)
Caused by: java.lang.NullPointerException
at net.minecraft.src.ItemStack.<init>(ItemStack.java:43)
at net.minecraft.src.RecipesCrafting.addRecipes(RecipesCrafting.java:54)
at net.minecraft.src.CraftingManager.<init>(CraftingManager.java:29)
at net.minecraft.src.CraftingManager.<clinit>(CraftingManager.java:9)
... 10 more
What dose that mean
Sorry to bother but I'm having a problem that when I try to test my mod in eclipse it says this:
27 achievements Exception in thread "main" java.lang.ExceptionInInitializerError at net.minecraft.src.StatList.initCraftableStats(StatList.java:130) at net.minecraft.src.StatList.initBreakableStats(StatList.java:105) at net.minecraft.src.Block.<clinit>(Block.java:1360) at net.minecraft.src.TextureWaterFX.<init>(TextureWaterFX.java:13) at net.minecraft.client.Minecraft.<init>(Minecraft.java:293) at net.minecraft.src.MinecraftImpl.<init>(MinecraftImpl.java:14) at net.minecraft.client.Minecraft.startMainThread(Minecraft.java:2446) at net.minecraft.client.Minecraft.startMainThread1(Minecraft.java:2432) at net.minecraft.client.Minecraft.main(Minecraft.java:2504) at Start.main(Start.java:22) Caused by: java.lang.NullPointerException at net.minecraft.src.ItemStack.<init>(ItemStack.java:43) at net.minecraft.src.RecipesCrafting.addRecipes(RecipesCrafting.java:54) at net.minecraft.src.CraftingManager.<init>(CraftingManager.java:29) at net.minecraft.src.CraftingManager.<clinit>(CraftingManager.java:9) ... 10 more What dose that mean
Btw, yes I do know how to use ITextureProvider and all. Do I have to do anything different?
it's probably just a easy mistake
BlockLSGreenstoneWire
LSModBlocks
mod_LSMod
Nope :\
I like to play FTB with some additions. Also custom modsets are awesome!
are you testing in eclipse, or recompiling? where you have your png matters depending on that.
go <MCP>/src/net/minecraft/net/src/minecraft.jar for eclipse,...
and <MCP>/jars/bin/minecraft.jar for recompiling.
That's all it took to fix my problem, at least
I like to play FTB with some additions. Also custom modsets are awesome!
mod_EnderFamily.java
Just checking to see if you are still planning the rest of your minecraftforge tutorials? All the others you have done have been quite helpful.
Thanks
public static final Item EnderScale = new Item(142).setIconIndex(9).setItemName("thth");
should be
public static final Item EnderScale = new ItemEnderScale(142).setIconIndex(9).setItemName("thth");
27 achievements
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.minecraft.src.StatList.initCraftableStats(StatList.java:130)
at net.minecraft.src.StatList.initBreakableStats(StatList.java:105)
at net.minecraft.src.Block.<clinit>(Block.java:1360)
at net.minecraft.src.TextureWaterFX.<init>(TextureWaterFX.java:13)
at net.minecraft.client.Minecraft.<init>(Minecraft.java:293)
at net.minecraft.src.MinecraftImpl.<init>(MinecraftImpl.java:14)
at net.minecraft.client.Minecraft.startMainThread(Minecraft.java:2446)
at net.minecraft.client.Minecraft.startMainThread1(Minecraft.java:2432)
at net.minecraft.client.Minecraft.main(Minecraft.java:2504)
at Start.main(Start.java:22)
Caused by: java.lang.NullPointerException
at net.minecraft.src.ItemStack.<init>(ItemStack.java:43)
at net.minecraft.src.RecipesCrafting.addRecipes(RecipesCrafting.java:54)
at net.minecraft.src.CraftingManager.<init>(CraftingManager.java:29)
at net.minecraft.src.CraftingManager.<clinit>(CraftingManager.java:9)
... 10 more
What dose that mean
Updates at twitter: https://twitter.com/luacs1998
27 achievements
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.minecraft.src.StatList.initCraftableStats(StatList.java:130)
at net.minecraft.src.StatList.initBreakableStats(StatList.java:105)
at net.minecraft.src.Block.<clinit>(Block.java:1360)
at net.minecraft.src.TextureWaterFX.<init>(TextureWaterFX.java:13)
at net.minecraft.client.Minecraft.<init>(Minecraft.java:293)
at net.minecraft.src.MinecraftImpl.<init>(MinecraftImpl.java:14)
at net.minecraft.client.Minecraft.startMainThread(Minecraft.java:2446)
at net.minecraft.client.Minecraft.startMainThread1(Minecraft.java:2432)
at net.minecraft.client.Minecraft.main(Minecraft.java:2504)
at Start.main(Start.java:22)
Caused by: java.lang.NullPointerException
at net.minecraft.src.ItemStack.<init>(ItemStack.java:43)
at net.minecraft.src.RecipesCrafting.addRecipes(RecipesCrafting.java:54)
at net.minecraft.src.CraftingManager.<init>(CraftingManager.java:29)
at net.minecraft.src.CraftingManager.<clinit>(CraftingManager.java:9)
... 10 more
What dose that mean