I wanted to create the furnace, and there are two errors:
mod_Repair:
package net.minecraft.src;
public class mod_Repair extends BaseMod{
public mod_Repair()
{
ModLoader.RegisterBlock(repairBlockOff);
ModLoader.RegisterBlock(repairBlockOn);
ModLoader.AddName(repairBlockOff, "Repair");
ModLoader.AddName(repairBlockOn, "Repair");
ModLoader.AddRecipe(new ItemStack(repairBlock, 1), new Object[] {
"X#X", "#X#", "#X#", Character.valueOf('X'), Item.redstone, Character.valueOf('#'), Block.dirt
});
}
public static final Block repairBlockOff;
public static final Block repairBlockOn;
public String Version()
{
return "1.7.3";
}
public static int repairBlockOff = ModLoader.addOverride("/terrain.png", "/repair/repairIddle.png");
public static int repairBlockOn = ModLoader.addOverride("/terrain.png", "/repair/reactorfrontactive.png");
public static int repairside = ModLoader.addOverride("/terrain.png", "/repair/reactorside.png");
public static int repairtop = ModLoader.addOverride("/terrain.png", "/repair/reactortop.png");
repairBlockOff = (new BlockRepair(116, false)).setHardness(3.5F).setBlockName("RepairOff").disableNeighborNotifyOnMetadataChange();
repairBlockOn = (new BlockRepair(117, true)).setHardness(3.5F).setLightValue(1.0F).setBlockName("RepairOn").disableNeighborNotifyOnMetadataChange();
}
BlockRepair:
package net.minecraft.src;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class BlockRepair extends BlockContainer
{
protected BlockRepair(int i, int j, boolean flag)
{
super(i, Material.rock);
field_28036_a = new Random();
isActive = flag;
setTickOnLoad(true);
blockIndexInTexture = mod_Repair.repairside;
}
protected boolean canThisPlantGrowOnThisBlockID(int i)
{
return i == Block.grass.blockID || i == Block.dirt.blockID || i == Block.stone.blockID;
}
public boolean canBlockStay(World world, int i, int j, int k)
{
return (canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k)));
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if((random.nextInt(1) == 0 && blockID == mod_Repair.repairBlockOn.blockID))
{
int l = (i + random.nextInt(3)) - 1;
int i1 = (j + random.nextInt(2)) - random.nextInt(2);
int j1 = (k + random.nextInt(3)) - 1;
}
if((random.nextInt(80) == 0 && blockID == mod_Repair.repairBlockOn.blockID))
{
int l = (i + random.nextInt(3)) - 1;
int i1 = (j + random.nextInt(2)) - random.nextInt(2);
int j1 = (k + random.nextInt(3)) - 1;
world.createExplosion(null, l, i1, j1, 20F);
}
}
public int idDropped(int i, Random random)
{
return mod_Repair.repairBlock.blockID;
}
public void onBlockAdded(World world, int i, int j, int k)
{
super.onBlockAdded(world, i, j, k);
}
private void setDefaultDirection(World world, int i, int j, int k)
{
if(world.multiplayerWorld)
{
return;
}
int l = world.getBlockId(i, j, k - 1);
int i1 = world.getBlockId(i, j, k + 1);
int j1 = world.getBlockId(i - 1, j, k);
int k1 = world.getBlockId(i + 1, j, k);
byte byte0 = 3;
if(Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[i1])
{
byte0 = 3;
}
if(Block.opaqueCubeLookup[i1] && !Block.opaqueCubeLookup[l])
{
byte0 = 2;
}
if(Block.opaqueCubeLookup[j1] && !Block.opaqueCubeLookup[k1])
{
byte0 = 5;
}
if(Block.opaqueCubeLookup[k1] && !Block.opaqueCubeLookup[j1])
{
byte0 = 4;
}
world.setBlockMetadataWithNotify(i, j, k, byte0);
}
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if(l == 1)
{
return mod_Repair.repairtop;
}
if(l == 0)
{
return mod_Repair.repairtop;
}
int i1 = iblockaccess.getBlockMetadata(i, j, k);
if(l != i1)
{
return blockIndexInTexture;
}
if(isActive)
{
return mod_Repair.repairBlockOn;
} else
{
return mod_Repair.repairside;
}
}
public void randomDisplayTick(World world, int i, int j, int k, Random random) // for some reason this doesn't work
{
if(!isActive)
{
return;
}
int l = world.getBlockMetadata(i, j, k);
float f = (float)i + 0.5F;
float f1 = (float)j + 0.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float)k + 0.5F;
float f3 = 0.52F;
float f4 = random.nextFloat() * 0.6F - 0.3F;
if(l == 4)
{
world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else
if(l == 5)
{
world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else
if(l == 2)
{
world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} else
if(l == 3)
{
world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
}
}
public int getBlockTextureFromSide(int i)
{
if(i == 1)
{
return mod_Repair.repairtop;
}
if(i == 0)
{
return mod_Repair.repairtop;
}
if(i == 3)
{
return mod_Repair.repairBlockOff;
} else
{
return blockIndexInTexture;
}
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(world.multiplayerWorld)
{
return true;
} else
{
TileEntityRepair tileentityrepair = (TileEntityRepair)world.getBlockTileEntity(i, j, k);
ModLoader.OpenGUI(ModLoader.getMinecraftInstance().thePlayer, new GuiRepair(ModLoader.getMinecraftInstance().thePlayer.inventory, tileentityrepair));
return true;
}
}
public static void updateRepairBlockState(boolean flag, World world, int i, int j, int k)
{
int l = world.getBlockMetadata(i, j, k);
TileEntity tileentity = world.getBlockTileEntity(i, j, k);
keepRepairInventory = true;
keepRepairInventory = false;
world.setBlockMetadataWithNotify(i, j, k, l);
tileentity.func_31004_j();
world.setBlockTileEntity(i, j, k, tileentity);
}
protected TileEntity getBlockEntity()
{
return new TileEntityRepair();
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if(l == 0)
{
world.setBlockMetadataWithNotify(i, j, k, 2);
}
if(l == 1)
{
world.setBlockMetadataWithNotify(i, j, k, 5);
}
if(l == 2)
{
world.setBlockMetadataWithNotify(i, j, k, 3);
}
if(l == 3)
{
world.setBlockMetadataWithNotify(i, j, k, 4);
}
}
public void onBlockRemoval(World world, int i, int j, int k)
{
if(!keepRepairInventory)
{
TileEntityRepair tileentityrepair = (TileEntityRepair)world.getBlockTileEntity(i, j, k);
label0:
for(int l = 0; l < tileentityrepair.getSizeInventory(); l++)
{
ItemStack itemstack = tileentityrepair.getStackInSlot(l);
if(itemstack == null)
{
continue;
}
float f = repairRand.nextFloat() * 0.8F + 0.1F;
float f1 = repairRand.nextFloat() * 0.8F + 0.1F;
float f2 = repairRand.nextFloat() * 0.8F + 0.1F;
do
{
if(itemstack.stackSize <= 0)
{
continue label0;
}
int i1 = repairRand.nextInt(21) + 10;
if(i1 > itemstack.stackSize)
{
i1 = itemstack.stackSize;
}
itemstack.stackSize -= i1;
EntityItem entityitem = new EntityItem(world, (float)i + f, (float)j + f1, (float)k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float)repairRand.nextGaussian() * f3;
entityitem.motionY = (float)repairRand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)repairRand.nextGaussian() * f3;
world.entityJoinedWorld(entityitem);
} while(true);
}
}
super.onBlockRemoval(world, i, j, k);
}
private Random repairRand;
private final boolean isActive;
public EntityPlayer entityplayer;
private static boolean keepRepairInventory = false;
}
I think I might have found out what is wrong with my mod. I deleted the glowstone_1 and glowstone_2 from my armor folder (I made a backup). It still had the white boxes so I think that it couldn't find the texture for the armor. There is a slight problem though.
When I reobfuscate my mod and install it into my minecraft.jar an error comes up and then the screen goes black before I can read the error message. I'm guessing that the error said that it couldn't find the texture files.
I think the textures were in the wrong folder. So, do you know which armor folder to put the textures in? The one in the minecraft.jar and the one in temp > bin > minecraft?
Ok, I think I might be able to do a dimension tutorial... But the only way to do it without modifying base classes is to not only need modloader but also Shockah API. Is everyone cool with this?
Ok, I think I might be able to do a dimension tutorial... But the only way to do it without modifying base classes is to not only need modloader but also Shockah API. Is everyone cool with this?
Yes that would be awesome! Also I need to know when the ore & tool tut will be finished because my tools are really glitchy right now.
The tree making stuff I've figured out has inspired me to make a tree mod! I might start it today.. BTW, the generating ore + tool set tut I can't do yet as my attempts at my own have been fine and it reob's fine. But when I mod my minecraft.jar it comes up with some retarted error. Also, that leaf decay code came up with errors aswell.
I'm loving these tuts. Its a really nice way to learn to mod mc!
Well thank you! It's nice to see that some people are getting good value from my tutorials! Enjoy! Also, I'm about half way done working out a modloader plant tutorial. One that's like wheat.
Hey im currenty working on a mod that adds blocks, items, armor, tools, and maybe other stuff...
But im stuck on the armour part when i try my mod...and i put on the armour its white! Then i read this " After modloader.addarmor, the NamehereArmor is what your
???_1 and ???_2 are called." Do you mean the path to the images?
mod_Repair:
BlockRepair:
When I reobfuscate my mod and install it into my minecraft.jar an error comes up and then the screen goes black before I can read the error message. I'm guessing that the error said that it couldn't find the texture files.
I think the textures were in the wrong folder. So, do you know which armor folder to put the textures in? The one in the minecraft.jar and the one in temp > bin > minecraft?
@AGMangoJuice_97, Thanks for that though someone already pm'ed me the info on it. I will give credit to both of you.
Yes that would be awesome! Also I need to know when the ore & tool tut will be finished because my tools are really glitchy right now.
Well thank you! It's nice to see that some people are getting good value from my tutorials! Enjoy! Also, I'm about half way done working out a modloader plant tutorial. One that's like wheat.
EDIT: Message sent.
I hope you can that would be extremely useful for people who download the mod!
Check out our website by clicking the banner!
But im stuck on the armour part when i try my mod...and i put on the armour its white! Then i read this " After modloader.addarmor, the NamehereArmor is what your
???_1 and ???_2 are called." Do you mean the path to the images?