Im having problems with the tool thing. For my sword mod, in titaniumswordTool.java, it underlines both toolMaterial's in red and it says "toolMaterial cannot be resolved into a variable".
Within my EnumToolMaterialtitaniumsword.java, it underlines the getEnchantability and the enchantability at the end and says "enchantability cannot be resolved into a variable" or "getEnchantability cannot be resolved into a variable"
Im having problems with the tool thing. For my sword mod, in titaniumswordTool.java, it underlines both toolMaterial's in red and it says "toolMaterial cannot be resolved into a variable".
Within my EnumToolMaterialtitaniumsword.java, it underlines the getEnchantability and the enchantability at the end and says "enchantability cannot be resolved into a variable" or "getEnchantability cannot be resolved into a variable"
Please help?
Are you making other tools besides a Titanium sword?
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
Firstly, you're making a new block, so you need to tell it that in your declaration. So, your public static final should look something like this:
public static final Block Test = new Test(200, 10).setBlockName("Test").setHardness(2F).setResistance(1000F).setLightValue(15F);
And since you have the number next to the blockID set to 10, it'll come out looking like all sides are made of the bottom of TNT. But this is a test, so that's fine.
That I can tell, that's really the only problem. But all those errors look like it's not registering that ModLoader is installed to the minecraft.jar... Did you install it to the .jar before decompiling?
I'm fine with the texture being tnt. And I fixed the 'declaring new block' thing. (The tutorial wasn't clear on that, so I took a random guess on whether to include 'Block'. I think i understand you need to declare what you are making)
Edit: Random question. In eclipse, above the code editor thingy is a run button. When I press run it runs minecraft, one that looks normal. Does this run minecraft with my code?
But with the modloader not being installed thing... I made sure i had modloader in there before I decompiled. At least i think. There is a mod folder in the .minecraft where i copied the .jar from (using MultiMC). I just grabbed a random version of ModLoader i found in my completely unorganized 'downloaded mods' folder. I'll try download modloader and decompile again. Is it ok to decompile again? Because then there will be two bin folders in the jar folder of MCP.
"The signature should be a place of thought and power, with images and personalities, not an advertising banner"
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
But with the modloader not being installed thing... I made sure i had modloader in there before I decompiled. At least i think. There is a mod folder in the .minecraft where i copied the .jar from (using MultiMC). I just grabbed a random version of ModLoader i found in my completely unorganized 'downloaded mods' folder. I'll try download modloader and decompile again. Is it ok to decompile again? Because then there will be two bin folders in the jar folder of MCP.
You shouldn't have 2 bin folders. It'd most likely not be a good idea, and I can't predict the results. And I don't know what MultiMC is...
Anyways, grab a current .jar and ModLoader... Except, you'll have to cleanup your workspace before you decompile again. There's a .bat file for that in your MCP directory. (cleanup.bat) You should probably back up the code and such before cleaning up. Once it's cleaned up and the .jar is all set up, decompile again.
Make sure everything's current, as I think each MCP is specific to a version.
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
i am trying to use the generate structures tutorial, and it runs fine. but when I try to start a new world, it gets stuck on the saving chunks screen. Could this be an error in my code, or is it just because i have a slow computer and it is being overwhelmed?
Rollback Post to RevisionRollBack
There are 10 types of people in the world. Those who understand binary notation, those who don't, and those who think this is in binary.
This is a tutorial about modding with ModLoader. If you want to mod without ModLoader you have to search for your own (i dont want to make ad for other tutorials)
So now i want to say that this tutorial is simply AWESOME! You really did/do a great job! I hope someday i will as good as you in modding/programming..
But now a few questions;
1. I made an unbreakable Block with a dirt texture but when i walk over it it sounds like stone.. Why you haven't add the "setStepSound" Method to the Block-Tutorial? Example:
.setStepSound(Block.soundGravelFootstep)
2. I also added unbreakable wood & planks to the creative inventory and i can see the different woodtextures in the inventory but when i choose one and place it, i place a wood block with standart wood texture...
declaration:
public static final Block unbreakPlanks = (new BlockWood(134)).setBlockName("unbreakPlanks")
.setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundWoodFootstep).disableStats().setRequiresSelfNotify();
public static final Block unbreakWood = (new BlockLog(135)).setBlockName("unbreakWood")
.setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundWoodFootstep).disableStats().setRequiresSelfNotify();
add to creative inventory:
for (int i2 = 0; i2 < 4; i2++) {list.add(new ItemStack(unbreakPlanks, 1, i2));}
//shows the difficult woodtextures in the inventory
for (int i2 = 0; i2 < 4; i2++) {list.add(new ItemStack(unbreakWood, 1, i2));}
//but if you place the block it has the default texture ! >.<
In your code for unbreakPlanks you have it set so it makes a new wood block, set that to planks. And for unbreakWood you set it to log, set that to wood instead.
I wonder that too, how do you limit something to just one specific tool. Like a block that can only be harvested with a stone shovel or a block that only drops when harvested with a golden pickaxe or a mob that only can be killed with a specific tool. Like Mo' Creatures werewolves only can be killed with a golden sword. Anybody knows how to do that?
Not sure where you got that idea from. I've killed plenty of werewolves, and none of them had even been struck with something gold. o.O
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
Zerolevels I have many times everything is either 1.8.1 or 1.7.3 do you have any idea how to make a crop
No. But I have an idea. I actually have a texture drawn up for a new flower and crop I want to add. I'll try to code it in and I'll share my experience.
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
I meant to say that I got your point in my previous post. My bad. Yes. I understand completely.
No. But I have an idea. I actually have a texture drawn up for a new flower and crop I want to add. I'll try to code it in and I'll share my experience.
There is no BlockPlanks.java or anything like that.. i would get an error like "Cannot find symbol" or so, if i do it like you said...
My mod works proper, really. Planks are called wood and wood is called log in MineCraft code.. look:
/* origianal code from Block.java*/
[...]
planks = (new BlockWood(5)).setHardness(2.0F).setResistance(5F).setStepSound(soundWoodFootstep)
.setBlockName("wood").setRequiresSelfNotify();
[...]
wood = (new BlockLog(17)).setHardness(2.0F).setStepSound(soundWoodFootstep)
.setBlockName("log").setRequiresSelfNotify();
[...]
And my mod if you want to try it out. And if you do it: it just works in creative and try to place an undestroyable birch wood block..
/*mod_unbreakableBlocks.java*/
package net.minecraft.src;
import java.util.Random;
import net.minecraft.client.Minecraft;
import java.util.List;
public class mod_unbreakableBlocks extends BaseMod
{
//creates undestroyable Blocks with skins of the terrain.png
public static final Block unbreakStone = (new Block(130, 1, Material.rock)).setBlockName("unbreakStone").setBlockUnbreakable().setResistance(600000F).disableStats();
public static final Block unbreakGrass = (BlockGrass)(new BlockGrass(131)).setBlockName("unbreakGrass").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundGrassFootstep).disableStats();
public static final Block unbreakDirt = (new Block(132, 2, Material.ground)).setBlockName("unbreakDirt").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundGravelFootstep).disableStats();
public static final Block unbreakCobble = (new Block(133, 16, Material.rock)).setBlockName("unbreakCobble").setBlockUnbreakable().setResistance(600000F).disableStats();
public static final Block unbreakPlanks = (new BlockWood(134)).setBlockName("unbreakPlanks").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundWoodFootstep).disableStats().setRequiresSelfNotify();
public static final Block unbreakWood = (new BlockLog(135)).setBlockName("unbreakWood").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundWoodFootstep).disableStats().setRequiresSelfNotify();
public static final Block unbreakSand = (new Block(136, 18, Material.sand)).setBlockName("unbreakSand").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundSandFootstep).disableStats();
public static final Block unbreakGravel = (new Block(137, 19, Material.sand)).setBlockName("unbreakGravel").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundGravelFootstep).disableStats();
public static final Block unbreakBricks = (new Block(138, 7, Material.rock)).setBlockName("unbreakBricks").setBlockUnbreakable().setResistance(600000F).disableStats();
public static final Block unbreakPortal = (new Block(139, 14, Material.portal)).setBlockName("unbreakPortal").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundGlassFootstep).disableStats();
public static final Block unbreakIron = (new Block(140, 22, Material.iron)).setBlockName("unbreakIron").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundMetalFootstep).disableStats();
public static final Block unbreakGold = (new Block(141, 23, Material.iron)).setBlockName("unbreakGold").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundMetalFootstep).disableStats();
public static final Block unbreakDia = (new Block(142, 24, Material.iron)).setBlockName("unbreakDia").setBlockUnbreakable().setResistance(600000F).setStepSound(Block.soundMetalFootstep).disableStats();
public static final Block unbreakTest = (new Block(150, 31, Material.portal)).setBlockName("unbreakTest").setBlockUnbreakable().setResistance(600000F).disableStats();
public static final Block unbreakTest2 = (new Block(151, 32, Material.rock)).setBlockName("unbreakTest2").setBlockUnbreakable().setResistance(600000F).disableStats();
public void load()
{
//http://www.minecraftforum.net/topic/960286-techguys-modding-tutorials-28-may-2012/ adding blocks to creative mode
ModLoader.setInGameHook(this, true, false);
ModLoader.setInGUIHook(this, true, false);
//registers the new Blocks
ModLoader.registerBlock(unbreakStone);
ModLoader.addName(unbreakStone, "undestroyable Stone Block");
ModLoader.addRecipe(new ItemStack(unbreakStone, 1), new Object [] {"#", Character.valueOf('#'), Block.stone});
ModLoader.registerBlock(unbreakGrass);
ModLoader.addName(unbreakGrass, "undestroyable Grass Block");
ModLoader.addRecipe(new ItemStack(unbreakGrass, 1), new Object [] {"#", Character.valueOf('#'), Block.grass});
ModLoader.registerBlock(unbreakDirt);
ModLoader.addName(unbreakDirt, "undestroyable Dirt");
ModLoader.registerBlock(unbreakCobble);
ModLoader.addName(unbreakCobble, "undestroyable Cobblestone");
ModLoader.registerBlock(unbreakPlanks);
ModLoader.addName(unbreakPlanks, "undestroyable Planks");
ModLoader.registerBlock(unbreakWood);
ModLoader.addName(unbreakWood, "undestroyable Wood");
ModLoader.registerBlock(unbreakSand);
ModLoader.addName(unbreakSand, "undestroyableSand");
ModLoader.registerBlock(unbreakGravel);
ModLoader.addName(unbreakGravel, "undestroyable Gravel");
ModLoader.registerBlock(unbreakBricks);
ModLoader.addName(unbreakBricks, "undestroyable Bricks");
ModLoader.registerBlock(unbreakPortal);
ModLoader.addName(unbreakPortal, "undestroyable Portal");
ModLoader.registerBlock(unbreakIron);
ModLoader.addName(unbreakIron, "undestroyable Block Of Iron");
ModLoader.registerBlock(unbreakGold);
ModLoader.addName(unbreakGold, "undestroyable Block Of Gold");
ModLoader.registerBlock(unbreakDia);
ModLoader.addName(unbreakDia, "undestroyable Block Of Diamonds");
ModLoader.registerBlock(unbreakTest);
ModLoader.addName(unbreakTest, "Test Block");
ModLoader.registerBlock(unbreakTest2);
ModLoader.addName(unbreakTest2, "Test Block2");
}
//registers the blocks in creative inventory
public boolean onTickInGame(float f, Minecraft minecraft)
{
if(minecraft.currentScreen == null)
{
creativeInventory = null;
}
return true;
}
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
{
if((guiscreen instanceof GuiContainerCreative) && !(creativeInventory instanceof GuiContainerCreative) && !minecraft.theWorld.isRemote)
{
Container container = ((GuiContainer)guiscreen).inventorySlots;
List list = ((ContainerCreative)container).itemList;
int i = 0;
list.add(new ItemStack(unbreakStone, 1, i));
list.add(new ItemStack(unbreakGrass, 1, i));
list.add(new ItemStack(unbreakDirt, 1, i));
list.add(new ItemStack(unbreakCobble, 1, i));
for (int i2 = 0; i2 < 4; i2++) {list.add(new ItemStack(unbreakPlanks, 1, i2));} //shows the difficult woodtextures in the inventory
for (int i2 = 0; i2 < 4; i2++) {list.add(new ItemStack(unbreakWood, 1, i2));} //but if you place the block it has the default texture ! >.<
list.add(new ItemStack(unbreakSand, 1, i));
list.add(new ItemStack(unbreakGravel, 1, i));
list.add(new ItemStack(unbreakBricks, 1, i));
list.add(new ItemStack(unbreakPortal, 1, i));
list.add(new ItemStack(unbreakIron, 1, i));
list.add(new ItemStack(unbreakGold, 1, i));
list.add(new ItemStack(unbreakDia, 1, i));
list.add(new ItemStack(unbreakTest, 1, i));
list.add(new ItemStack(unbreakTest2, 1, i));
}
creativeInventory = guiscreen;
return true;
}
private static GuiScreen creativeInventory;
public String getVersion()
{
return "1.2.5";
}
}
btw try it with iron-weapons (silver) ^^
I have no idea how to realize the main problem..
I just found the code of the pickaxe tools.. Maybe it is possible to modify it but that is not the idea of ModLoader..
/*ItemPickaxe.java*/
[...]
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
if (par1Block == Block.obsidian)
{
return toolMaterial.getHarvestLevel() == 3;
}
if (par1Block == Block.blockDiamond || par1Block == Block.oreDiamond)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (par1Block == Block.blockGold || par1Block == Block.oreGold)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (par1Block == Block.blockSteel || par1Block == Block.oreIron)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (par1Block == Block.blockLapis || par1Block == Block.oreLapis)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (par1Block == Block.oreRedstone || par1Block == Block.oreRedstoneGlowing)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (par1Block.blockMaterial == Material.rock)
{
return true;
}
return par1Block.blockMaterial == Material.iron;
}
[...]
Do you ever heard something about "spawneggs"? maybe you should take a look in their code..
EDIT1: spawneggs are called "MonsterPlacer" in MineCraft code:
/*ItemMonsterPlacer.java*/
[...]
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7)
{
if (par3World.isRemote)
{
return true;
}
int i = par3World.getBlockId(par4, par5, par6);
par4 += Facing.offsetsXForSide[par7];
par5 += Facing.offsetsYForSide[par7];
par6 += Facing.offsetsZForSide[par7];
double d = 0.0D;
if (par7 == 1 && i == Block.fence.blockID || i == Block.netherFence.blockID)
{
d = 0.5D;
}
if (spawnCreature(par3World, par1ItemStack.getItemDamage(), (double)par4 + 0.5D, (double)par5 + d, (double)par6 + 0.5D) && !par2EntityPlayer.capabilities.isCreativeMode)
{
par1ItemStack.stackSize--;
}
return true;
}
[...]
EDIT2: Why the Forum doesn't show who I have qouted?!
Minecraft doesn't need a BlockPlanks.java if the block doesn't have any special attributes(as in its a normal, non-opaque block) So look in block.java for ALL blocks, don't just look for the java file because not all have them. "Block.planks.blockID" is the code for planks, switch log to wood and wood to planks and things should work better
Hi...I'm trying to make my custom grass grow over my custom dirt, and I've set up the code. But I have 3 errors in my recompiler...help?
Error: Error
aliengrass.java
package net.minecraft.src;
public class aliengrass extends Block
{
public aliengrass(int i, int j)
{
super(i, j, Material.wood);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_MangMod.aliengrassbottom;
}
if (i == 1)
{
return mod_MangMod.aliengrasstop;
}
else
{
return mod_MangMod.aliengrassside;
}
}
public int idDropped(int i, Random random, int j)
{
return mod_MangMod.aliendirt.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (par1World.isRemote)
{
return;
}
if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2)
{
par1World.setBlockWithNotify(par2, par3, par4, mod_MangMod.aliendirt.blockID);
}
else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
for (int i = 0; i < 4; i++)
{
int j = (par2 + par5Random.nextInt(3)) - 1;
int k = (par3 + par5Random.nextInt(5)) - 3;
int l = (par4 + par5Random.nextInt(3)) - 1;
int i1 = par1World.getBlockId(j, k + 1, l);
if (par1World.getBlockId(j, k, l) == mod_MangMod.aliendirt.blockID && par1World.getBlockLightValue(j, k + 1, l) >= 4 && Block.lightOpacity[i1] <= 2)
{
par1World.setBlockWithNotify(j, k, l, mod_MangMod.aliengrass.blockID);
}
}
}
}
}
Hi...I'm trying to make my custom grass grow over my custom dirt, and I've set up the code. But I have 3 errors in my recompiler...help?
Error: Error
aliengrass.java
package net.minecraft.src;
public class aliengrass extends Block
{
public aliengrass(int i, int j)
{
super(i, j, Material.wood);
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_MangMod.aliengrassbottom;
}
if (i == 1)
{
return mod_MangMod.aliengrasstop;
}
else
{
return mod_MangMod.aliengrassside;
}
}
public int idDropped(int i, Random random, int j)
{
return mod_MangMod.aliendirt.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (par1World.isRemote)
{
return;
}
if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2)
{
par1World.setBlockWithNotify(par2, par3, par4, mod_MangMod.aliendirt.blockID);
}
else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
for (int i = 0; i < 4; i++)
{
int j = (par2 + par5Random.nextInt(3)) - 1;
int k = (par3 + par5Random.nextInt(5)) - 3;
int l = (par4 + par5Random.nextInt(3)) - 1;
int i1 = par1World.getBlockId(j, k + 1, l);
if (par1World.getBlockId(j, k, l) == mod_MangMod.aliendirt.blockID && par1World.getBlockLightValue(j, k + 1, l) >= 4 && Block.lightOpacity[i1] <= 2)
{
par1World.setBlockWithNotify(j, k, l, mod_MangMod.aliengrass.blockID);
}
}
}
}
}
This code may or may not work, I am just posting from what I can assume would work, if the code doesn't work I'm sorry! REMEMBER BACKUPS!!!!
To fix your error you can put this on the second line(after the package line):
import java.util.Random;
OR IF YOU WANT MORE REALISTIC GRASS:
Try copying the code from BlockGrass.java completely and modifying it for your needs. That way it will render like grass. So your code would essentially look like this:
Blockaliengrass.java:
package net.minecraft.src;
import java.util.Random;
public class Blockaliengrass extends BlockFlower
{
protected Blockaliengrass(int par1, int par2)
{
super(par1, par2, Material.vine);
float f = 0.4F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f);
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par2 == 1)
{
return blockIndexInTexture;
}
if (par2 == 2)
{
return blockIndexInTexture + 16 + 1;
}
if (par2 == 0)
{
return blockIndexInTexture + 16;
}
else
{
return blockIndexInTexture;
}
}
public int getBlockColor()
{
double d = 0.5D;
double d1 = 1.0D;
return ColorizerGrass.getGrassColor(d, d1);
}
/**
* Returns the color this block should be rendered. Used by leaves.
*/
public int getRenderColor(int par1)
{
if (par1 == 0)
{
return 0xffffff;
}
else
{
return ColorizerFoliage.getFoliageColorBasic();
}
}
/**
* Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
* when first determining what to render.
*/
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
int i = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
if (i == 0)
{
return 0xffffff;
}
else
{
return par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor();
}
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
if (par2Random.nextInt(8) == 0)
{
return Item.seeds.shiftedIndex;
}
else
{
return -1;
}
}
/**
* Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive).
*/
public int quantityDroppedWithBonus(int par1, Random par2Random)
{
return 1 + par2Random.nextInt(par1 * 2 + 1);
}
/**
* Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the
* block and l is the block's subtype/damage.
*/
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{
if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
{
par2EntityPlayer.addStat(StatList.mineBlockStatArray[blockID], 1);
dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6));
}
else
{
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
}
}
}
Since tallgrass is spawned using a default minecraft file we should probably try and not edit it. Make a new file called WorldGenAlienGrass.java and put this code in it:
package net.minecraft.src;
import java.util.Random;
public class WorldGenAlienGrass extends WorldGenerator
{
/** Stores ID for WorldGenTallGrass */
private int aliengrassID;
private int aliengrassMetadata;
public WorldGenAlienGrass(int par1, int par2)
{
tallGrassID = par1;
tallGrassMetadata = par2;
}
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
for (int i = 0; ((i = par1World.getBlockId(par3, par4, par5)) == 0 || i == Block.leaves.blockID) && par4 > 0; par4--) { }
for (int j = 0; j < 128; j++)
{
int k = (par3 + par2Random.nextInt(8)) - par2Random.nextInt(8);
int l = (par4 + par2Random.nextInt(4)) - par2Random.nextInt(4);
int i1 = (par5 + par2Random.nextInt(8)) - par2Random.nextInt(8);
if (par1World.isAirBlock(k, l, i1) && ((BlockFlower)Block.blocksList[aliengrassID]).canBlockStay(par1World, k, l, i1))
{
par1World.setBlockAndMetadata(k, l, i1, aliengrassID, aliengrassMetadata);
}
}
return true;
}
}
Within my EnumToolMaterialtitaniumsword.java, it underlines the getEnchantability and the enchantability at the end and says "enchantability cannot be resolved into a variable" or "getEnchantability cannot be resolved into a variable"
Please help?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffAre you making other tools besides a Titanium sword?
I'm fine with the texture being tnt. And I fixed the 'declaring new block' thing. (The tutorial wasn't clear on that, so I took a random guess on whether to include 'Block'. I think i understand you need to declare what you are making)
Edit: Random question. In eclipse, above the code editor thingy is a run button. When I press run it runs minecraft, one that looks normal. Does this run minecraft with my code?
But with the modloader not being installed thing... I made sure i had modloader in there before I decompiled. At least i think. There is a mod folder in the .minecraft where i copied the .jar from (using MultiMC). I just grabbed a random version of ModLoader i found in my completely unorganized 'downloaded mods' folder. I'll try download modloader and decompile again. Is it ok to decompile again? Because then there will be two bin folders in the jar folder of MCP.
Now why does the above statement contradict itself when put into a signature? PM me if you find out.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffYou shouldn't have 2 bin folders. It'd most likely not be a good idea, and I can't predict the results. And I don't know what MultiMC is...
Anyways, grab a current .jar and ModLoader... Except, you'll have to cleanup your workspace before you decompile again. There's a .bat file for that in your MCP directory. (cleanup.bat) You should probably back up the code and such before cleaning up. Once it's cleaned up and the .jar is all set up, decompile again.
Make sure everything's current, as I think each MCP is specific to a version.
Nope
just the titanium sword to start with
-
View User Profile
-
View Posts
-
Send Message
Retired StaffAlright. Let me see the code for the 3 tool-related classes you made as well as your mod_* class. Be sure to put them all in spoilers.
Only when use GoldenPickaxe
edit 1: i read the tool tutrial, i make a sword and worked but i didn´t find how to do a block that only drop a item when you use GoldenPickaxe
In your code for unbreakPlanks you have it set so it makes a new wood block, set that to planks. And for unbreakWood you set it to log, set that to wood instead.
-
View User Profile
-
View Posts
-
Send Message
Retired Staff"Plant" is a bit obscure. Try searching for tutorials on crops.
Not sure where you got that idea from. I've killed plenty of werewolves, and none of them had even been struck with something gold. o.O
-
View User Profile
-
View Posts
-
Send Message
Retired StaffI meant to say that I got your point in my previous post. My bad. Yes. I understand completely.
No. But I have an idea. I actually have a texture drawn up for a new flower and crop I want to add. I'll try to code it in and I'll share my experience.
Do you know how to make a new furnace
Minecraft doesn't need a BlockPlanks.java if the block doesn't have any special attributes(as in its a normal, non-opaque block) So look in block.java for ALL blocks, don't just look for the java file because not all have them. "Block.planks.blockID" is the code for planks, switch log to wood and wood to planks and things should work better
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumError: Error
aliengrass.java
package net.minecraft.src; public class aliengrass extends Block { public aliengrass(int i, int j) { super(i, j, Material.wood); } public int getBlockTextureFromSideAndMetadata(int i, int j) { return getBlockTextureFromSide(i); } public int getBlockTextureFromSide(int i) { if (i == 0) { return mod_MangMod.aliengrassbottom; } if (i == 1) { return mod_MangMod.aliengrasstop; } else { return mod_MangMod.aliengrassside; } } public int idDropped(int i, Random random, int j) { return mod_MangMod.aliendirt.blockID; } public int quantityDropped(Random random) { return 1; } public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (par1World.isRemote) { return; } if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) { par1World.setBlockWithNotify(par2, par3, par4, mod_MangMod.aliendirt.blockID); } else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { for (int i = 0; i < 4; i++) { int j = (par2 + par5Random.nextInt(3)) - 1; int k = (par3 + par5Random.nextInt(5)) - 3; int l = (par4 + par5Random.nextInt(3)) - 1; int i1 = par1World.getBlockId(j, k + 1, l); if (par1World.getBlockId(j, k, l) == mod_MangMod.aliendirt.blockID && par1World.getBlockLightValue(j, k + 1, l) >= 4 && Block.lightOpacity[i1] <= 2) { par1World.setBlockWithNotify(j, k, l, mod_MangMod.aliengrass.blockID); } } } } }To fix your error you can put this on the second line(after the package line):
OR IF YOU WANT MORE REALISTIC GRASS:
Try copying the code from BlockGrass.java completely and modifying it for your needs. That way it will render like grass. So your code would essentially look like this:
Blockaliengrass.java:
package net.minecraft.src; import java.util.Random; public class Blockaliengrass extends BlockFlower { protected Blockaliengrass(int par1, int par2) { super(par1, par2, Material.vine); float f = 0.4F; setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public int getBlockTextureFromSideAndMetadata(int par1, int par2) { if (par2 == 1) { return blockIndexInTexture; } if (par2 == 2) { return blockIndexInTexture + 16 + 1; } if (par2 == 0) { return blockIndexInTexture + 16; } else { return blockIndexInTexture; } } public int getBlockColor() { double d = 0.5D; double d1 = 1.0D; return ColorizerGrass.getGrassColor(d, d1); } /** * Returns the color this block should be rendered. Used by leaves. */ public int getRenderColor(int par1) { if (par1 == 0) { return 0xffffff; } else { return ColorizerFoliage.getFoliageColorBasic(); } } /** * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called * when first determining what to render. */ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { int i = par1IBlockAccess.getBlockMetadata(par2, par3, par4); if (i == 0) { return 0xffffff; } else { return par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor(); } } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { if (par2Random.nextInt(8) == 0) { return Item.seeds.shiftedIndex; } else { return -1; } } /** * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). */ public int quantityDroppedWithBonus(int par1, Random par2Random) { return 1 + par2Random.nextInt(par1 * 2 + 1); } /** * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the * block and l is the block's subtype/damage. */ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex) { par2EntityPlayer.addStat(StatList.mineBlockStatArray[blockID], 1); dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6)); } else { super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); } } }package net.minecraft.src; import java.util.Random; public class WorldGenAlienGrass extends WorldGenerator { /** Stores ID for WorldGenTallGrass */ private int aliengrassID; private int aliengrassMetadata; public WorldGenAlienGrass(int par1, int par2) { tallGrassID = par1; tallGrassMetadata = par2; } public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { for (int i = 0; ((i = par1World.getBlockId(par3, par4, par5)) == 0 || i == Block.leaves.blockID) && par4 > 0; par4--) { } for (int j = 0; j < 128; j++) { int k = (par3 + par2Random.nextInt(8)) - par2Random.nextInt(8); int l = (par4 + par2Random.nextInt(4)) - par2Random.nextInt(4); int i1 = (par5 + par2Random.nextInt(8)) - par2Random.nextInt(8); if (par1World.isAirBlock(k, l, i1) && ((BlockFlower)Block.blocksList[aliengrassID]).canBlockStay(par1World, k, l, i1)) { par1World.setBlockAndMetadata(k, l, i1, aliengrassID, aliengrassMetadata); } } return true; } }