I seem to be having a problem that I do not understand... in my mod_ file I get a error at .setItemName(NaturalMana)
The method setItemName(String) in the type Item is not applicable for the arguments (Item)
Also I'm not sure what I did, but I get 47 errors from paulscode and SoundSystem (I have not modified either of these that I know of) saying that they can not be resolved to a type.
Here is my mod_ file:
package net.minecraft.src;
public class mod_Theocraft extends BaseMod
{
//Declaration
public static final Block MagicBlock = (new MagicBlock (200, ModLoader.addOverride("/terrain.png", "/Theocraft/Blocks/MagicBlock.png")).setHardness(5.0F).setResistance(10.0F).setLightValue(10.0F).setBlockName("MagicBlock"));
public static final Item NaturalMana = (new NaturalMana(69133769).setIconIndex(ModLoader.addOverride("/gui/items.png", "/Theocraft/Items/NaturalMana.png")).setItemName(NaturalMana));
public void load()
{
ModLoader.registerBlock(MagicBlock);
ModLoader.addName(MagicBlock, "Magic Block");
ModLoader.addName(NaturalMana, "Natural Mana");
ModLoader.addRecipe(new ItemStack(NaturalMana, 1), new Object [] {"#", Character.valueOf('#'), Block.sand});
ModLoader.addRecipe(new ItemStack(MagicBlock, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "Theocraft";
}
}
Thanks a ton man =) Now to figure out the 47 errors I'm getting from files I haven't touched...
EDIT: I fixed my 47 error prob but now I have a new one I made a mob and it had no errors but I couldn't find it, and after some exploration I eventually discovered that my mobs are invisible or does not have a model or sumptin. So I have a mob, captured one, but I can't see it, any ideas? Here is my Render File (I assume its a rendering problem)
please do a tutorial on custom armor effects...no where in the world is there a good tutorial... no errors in my code, but nothing appears to go into the system
I have an error with armor as all of my armor gives equal strength to diamond armor found it why its doing this and will post the bad code below
package net.minecraft.src;[/background][/size][/font][/color]
[color=#333333][font=arial, sans-serif][size=small][background=rgb(235, 235, 235)]public class MOD_NAMEItemArmor extends ItemArmor
{
private static final int maxDamageArray[] = {
11, 16, 15, 13
};
public final int armorType;
public final int damageReduceAmount;
public final int renderIndex;
private final DiabloArmorMaterial material;
public MOD_NAMEItemArmor(int i, MOD_NAMEArmorMaterial enumarmormaterial, int j, int k)
{
super(i, EnumArmorMaterial.DIAMOND, j, k);
material = enumarmormaterial;
armorType = k;
renderIndex = j;
damageReduceAmount = enumarmormaterial.getDamageReductionAmount(k);
setMaxDamage(enumarmormaterial.func_40576_a(k));
maxStackSize = 1;
}
public int getItemEnchantability()
{
return material.getEnchantability();
}
static int[] getMaxDamageArray()
{
return maxDamageArray;
}
}
You are amazing, honestly. I have never seen such detailed and thorough tutorials in a long time. You've answered pretty much every question i've had about modding, and updating my Wolfestone Mod to 1.3.1 should be a breeze now xP
(Insert sad noob face) I can't get my dimensions portal block to work ;_; it instead of taking me to my dimension takes me to the nether, also I changed it so there is no portal overlay, but in-game the overlay was still there, it has the texture and stuff tho. I never copy pasted from the nether portal or anything nether related.
Here is my Portal Block file:
package net.minecraft.src;
import java.util.List;
import java.util.ArrayList;
public class BlockTheocraftPortal extends BlockPortalBase
{
//Look in BlockPortalBase.java to see the full array of hooks you can use for your portal block.
public BlockTheocraftPortal(int i)
{
super(i, ModLoader.addOverride("/terrain.png", "/Theocraft/Blocks/TheocraftPortal.png"), Material.portal);
//Get a unique sprite index for the portal texture so that it doesn't override another
//texture.
}
public WorldProviderBase getDimension()
{
return new WorldProviderTheocraft();
}
public Teleporter getTeleporter()
{
return new TheocraftTeleporter();
}
//You can get to this dimension from the overworld (0) and Nether (-1).
//You should probably make the portal non-solid so you can step into it...
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == blockID || par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == blockID)
{
float f = 0.5F;
float f2 = 0.125F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f2, 0.5F + f, 1.0F, 0.5F + f2);
}
else
{
float f1 = 0.125F;
float f3 = 0.5F;
setBlockBounds(0.5F - f1, 0.0F, 0.5F - f3, 0.5F + f1, 1.0F, 0.5F + f3);
}
}
public List canTeleportFromDimension()
{
ArrayList arraylist = new ArrayList();
arraylist.add(Integer.valueOf(0));//player can teleport from overworld to this dimension
return arraylist;
}
/**
* Is this block (a) opaque and ( a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* Checks to see if this location is valid to create a portal and will return True if it does. Args: world, x, y, z
*/
public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
{
int i = 0;
int j = 0;
if (par1World.getBlockId(par2 - 1, par3, par4) == mod_Theocraft.MagicBlock.blockID || par1World.getBlockId(par2 + 1, par3, par4) == mod_Theocraft.MagicBlock.blockID)
{
i = 1;
}
if (par1World.getBlockId(par2, par3, par4 - 1) == mod_Theocraft.MagicBlock.blockID || par1World.getBlockId(par2, par3, par4 + 1) == mod_Theocraft.MagicBlock.blockID)
{
j = 1;
}
if (i == j)
{
return false;
}
if (par1World.getBlockId(par2 - i, par3, par4 - j) == 0)
{
par2 -= i;
par4 -= j;
}
for (int k = -1; k <= 2; k++)
{
for (int i1 = -1; i1 <= 3; i1++)
{
boolean flag = k == -1 || k == 2 || i1 == -1 || i1 == 3;
if ((k == -1 || k == 2) && (i1 == -1 || i1 == 3))
{
continue;
}
int k1 = par1World.getBlockId(par2 + i * k, par3 + i1, par4 + j * k);
if (flag)
{
if (k1 != mod_Theocraft.MagicBlock.blockID)
{
return false;
}
continue;
}
if (k1 != 0 && k1 != Block.fire.blockID)
{
return false;
}
}
}
par1World.editingBlocks = true;
for (int l = 0; l < 2; l++)
{
for (int j1 = 0; j1 < 3; j1++)
{
par1World.setBlockWithNotify(par2 + i * l, par3 + j1, par4 + j * l, mod_Theocraft.BlockTheocraftPortal.blockID);
}
}
par1World.editingBlocks = false;
return true;
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
int i = 0;
int j = 1;
if (par1World.getBlockId(par2 - 1, par3, par4) == blockID || par1World.getBlockId(par2 + 1, par3, par4) == blockID)
{
i = 1;
j = 0;
}
int k;
for (k = par3; par1World.getBlockId(par2, k - 1, par4) == blockID; k--) { }
if (par1World.getBlockId(par2, k - 1, par4) != mod_Theocraft.MagicBlock.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
int l;
for (l = 1; l < 4 && par1World.getBlockId(par2, k + l, par4) == blockID; l++) { }
if (l != 3 || par1World.getBlockId(par2, k + l, par4) != mod_Theocraft.MagicBlock.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == blockID || par1World.getBlockId(par2 + 1, par3, par4) == blockID;
boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == blockID || par1World.getBlockId(par2, par3, par4 + 1) == blockID;
if (flag && flag1)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
if ((par1World.getBlockId(par2 + i, par3, par4 + j) != mod_Theocraft.MagicBlock.blockID || par1World.getBlockId(par2 - i, par3, par4 - j) != blockID) && (par1World.getBlockId(par2 - i, par3, par4 - j) != mod_Theocraft.MagicBlock.blockID || par1World.getBlockId(par2 + i, par3, par4 + j) != blockID))
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
else
{
return;
}
}
/**
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
* coordinates. Args: blockAccess, x, y, z, side
*/
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
if (par1IBlockAccess.getBlockId(par2, par3, par4) == blockID)
{
return false;
}
boolean flag = par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == blockID && par1IBlockAccess.getBlockId(par2 - 2, par3, par4) != blockID;
boolean flag1 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == blockID && par1IBlockAccess.getBlockId(par2 + 2, par3, par4) != blockID;
boolean flag2 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == blockID && par1IBlockAccess.getBlockId(par2, par3, par4 - 2) != blockID;
boolean flag3 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == blockID && par1IBlockAccess.getBlockId(par2, par3, par4 + 2) != blockID;
boolean flag4 = flag || flag1;
boolean flag5 = flag2 || flag3;
if (flag4 && par5 == 4)
{
return true;
}
if (flag4 && par5 == 5)
{
return true;
}
if (flag5 && par5 == 2)
{
return true;
}
return flag5 && par5 == 3;
}
public boolean displayPortalOverlay()
{
return false;
}
public int getOverlayTexture()
{
return blockIndexInTexture;
}
public int getPortalDelay()
{
return 85;//default
}
public String getEnteringMessage() {
return "Welcome to Theocraft";
}
public String getLeavingMessage() {
return "Have a nice day";
}
}
If you need any of the other files, just say so. ;_;
EVERYBODY! I have begun the stretch of updating my tuts to 1.3.1. Just remade the Blocks tut...improved and well worth watching again, even if you already know how to do it
EVERYBODY! I have begun the stretch of updating my tuts to 1.3.1. Just remade the Blocks tut...improved and well worth watching again, even if you already know how to do it
While updating them, could you add a tutorial for making an item (item, not block) you hold in you hand that emits light? Also a helmet you can put on that emits light. That would really help my friend.
Thank you!
The method setItemName(String) in the type Item is not applicable for the arguments (Item)
Also I'm not sure what I did, but I get 47 errors from paulscode and SoundSystem (I have not modified either of these that I know of) saying that they can not be resolved to a type.
Here is my mod_ file:
I changed it to 700 and that didn't fix anything.
Change it from
To
Thanks a ton man =) Now to figure out the 47 errors I'm getting from files I haven't touched...
EDIT: I fixed my 47 error prob but now I have a new one I made a mob and it had no errors but I couldn't find it, and after some exploration I eventually discovered that my mobs are invisible or does not have a model or sumptin. So I have a mob, captured one, but I can't see it, any ideas? Here is my Render File (I assume its a rendering problem)
Check out my Minecraft Modding Tutorials!
Here is my Portal Block file:
If you need any of the other files, just say so. ;_;
While updating them, could you add a tutorial for making an item (item, not block) you hold in you hand that emits light? Also a helmet you can put on that emits light. That would really help my friend.