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;
}
}
I don't get errors now...but my alien grass won't turn my alien dirt into alien grass, help?
package net.minecraft.src;
import java.util.Random;
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);
}
}
}
}
}
I don't get errors now...but my alien grass won't turn my alien dirt into alien grass, help?
package net.minecraft.src;
import java.util.Random;
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);
}
}
}
}
}
Please post all of your mod files pertaining to the problem, that would help a lot. But first, does the alien dirt get generated?
Yes, the alien dirt is generated in the level. But the Alien Grass won't convert it into Alien Grass like Grass would to Dirt.
aliengrass.java
package net.minecraft.src;
import java.util.Random;
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);
}
}
}
}
}
aliendirt.java
package net.minecraft.src;
import java.util.Random;
public class aliendirt extends Block
{
public aliendirt(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_MangMod.aliendirt.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
Maybe you could try and switch it around so it applys to blocks?
i keep getting 1 error when recompiling from my custom pickaxe
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files (x86)\Java\jdk1.7.0_04\bin\javac" -Xlint:-options -deprecatio
n -g -source 1.6 -tar...' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_ShadowPack.java:30: error: cannot find symbo
l
public static final Item ShadowPick = new ItemPickaxe(799,EnumToolMaterialShadow
Diamond).setItemName("shadowpick");
^
symbol: variable EnumToolMaterialShadowDiamond
location: class mod_ShadowPack
1 error
==================
!! Can not find server sources, try decompiling !!
Press any key to continue . . .
my EnumToolMaterial code is
package net.minecraft.src;
public enum EnumToolMaterialShadowDiamond
{
ShadowDiamond(0, 59, 2.0F, 0, 15);
private final int harvestLevel;
private final int maxUses;
private final float efficiencyOnProperMaterial;
private final int damageVsEntity;
private final int enchantability;
private EnumToolMaterialShadowDiamond(int par3, int par4, float par5, int par6, int par7)
{
harvestLevel = par3;
maxUses = par4;
efficiencyOnProperMaterial = par5;
damageVsEntity = par6;
enchantability = par7;
}
public int getMaxUses()
{
return 5500;
}
public float getEfficiencyOnProperMaterial()
{
return 10f;
}
public int getDamageVsEntity()
{
return 5;
}
public int getHarvestLevel()
{
return 6;
}
public int getEnchantability()
{
return 100;
}
}
Any Ideas?
For your pick it should be public static final Item ShadowPick = new ItemPickaxe(799,EnumToolMaterialShadow
Diamond.ShadowDiamond).setItemName("shadowpick");
Yes, the alien dirt is generated in the level. But the Alien Grass won't convert it into Alien Grass like Grass would to Dirt.
aliengrass.java
package net.minecraft.src;
import java.util.Random;
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);
}
}
}
}
}
aliendirt.java
package net.minecraft.src;
import java.util.Random;
public class aliendirt extends Block
{
public aliendirt(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_MangMod.aliendirt.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
well then that means that the if statement is not getting what is required to turn it into aliengrass. Try getting rid of
Removed that line, but the grass still doesn't grow. Can we add it back though? Because I want it to require light like normal grass.
EDIT: Ok, another issue completely unrelated. I just tried compiling my mod then reobing it, and got the reobed folder. I compressed it into a zip, then put it into my mods folder. Nothing changed. Did I do something wrong?
Removed that line, but the grass still doesn't grow. Can we add it back though? Because I want it to require light like normal grass.
Yes you can, like I said that was just a test to see if it spawned with a variable that should be true if the aliendirt generated. Post your mod file that would help.
Okay, I figured it out. Try placing down one of your aliendirt blocks, after a few seconds it should change to your grass just as dirt does in default minecraft. If you want your grass to spawn immediately you'll have to put in generation code for it. Does your aliendirt spawn in only on top or is it at least 2 blocks deep? If it's two blocks deep or more just uncover one and it should change to your grass block.
My biome works fine...my alien grass spawns on the top and dirt is below. If I put down alien dirt, alien grass doesn't convert the alien dirt to alien grass, I don't think you understood me. I want it to work like default MC, but it won't..
My biome works fine...my alien grass spawns on the top and dirt is below. If I put down alien dirt, alien grass doesn't convert the alien dirt to alien grass, I don't think you understood me. I want it to work like default MC, but it won't..
I understood you, you misunderstood me. Go dig a hole in grass and watch how the dirt underneath get's converted to grass blocks. That is the code that you edited. If you wanted the grass just to generate you need to put that in your generation class.
Thank you, i changed the EnumToolMaterial to the correct one and i tried all the suggestions to fix it but still no joy , everything else in the mod works fine, exept the damn tool
Your checklist:
mod_yourmod-have the pick declared and everything-check
ItemSwordDerp-make sure it's the sword code
ItemWhateverSwordTool-You must have this, it's the ItemNamehereTool class
YOU MUST HAVE THOSE THREE FILES-if you have all of them, post the code here and we'll check it out
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;
}
[...]
so I figured out enough to get EntityLiving entityliving = (EntityLiving)EntityList.createEntityByID(100, par1World);
(not just that I got everything else straightened out) what is par1World? I found it in Entity list but I cannot get what it does.
Rollback Post to RevisionRollBack
I said that I would save people, guess I still have no soul.
I understood you, you misunderstood me. Go dig a hole in grass and watch how the dirt underneath get's converted to grass blocks. That is the code that you edited. If you wanted the grass just to generate you need to put that in your generation class.
The grass thing is what I want my alien grass to do, but it won't do that, it just sits there. The custom grass won't grow onto my custom dirt.
Can i get some help? just wanted to make something for test ^^
it doesnt load ingame at all
Mod_Fleshtools
package net.minecraft.src;
public class Mod_Fleshtools extends BaseMod
{
public static final Item pickaxe = new FleshPickaxe(2000, EnumToolMaterialFlesh.Flesh).setItemName("pickaxe");
public static final Item axe = new FleshAxe(2001, EnumToolMaterialFlesh.Flesh).setItemName("axe");
public static final Item shovel = new FleshShovel(2002, EnumToolMaterialFlesh.Flesh).setItemName("shovel");
public static final Item sword = new FleshSword(2003, EnumToolMaterialFlesh.Flesh).setItemName("sword");
public static final Item hoe = new FleshHoe(2004, EnumToolMaterialFlesh.Flesh).setItemName("hoe");
public void load()
{
pickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/tools/FleshPickaxe.png");
axe.iconIndex = ModLoader.addOverride("/gui/items.png", "/tools/FleshAxe.png");
shovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/tools/FleshSpade.png");
sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/tools/FleshSword.png");
hoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/tools/FleshHoe.png");
ModLoader.addName(pickaxe, "Pickaxe");
ModLoader.addName(axe, "Axe");
ModLoader.addName(shovel, "Shovel");
ModLoader.addName(sword, "Sword");
ModLoader.addName(hoe, "Hoe");
ModLoader.addRecipe(new ItemStack(pickaxe, 1), new Object [] {"###", " % ", " % ", '#', Item.porkRaw, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(axe, 1), new Object [] {"## ", "#% ", " % ", '#', Item.porkRaw, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(shovel, 1), new Object [] {" # ", " % ", " % ", '#', Item.porkRaw, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" # ", " # ", " % ", '#', Character.valueOf('#'), Item.porkRaw, Character.valueOf('%'), Item.stick});
ModLoader.addRecipe(new ItemStack(hoe, 1), new Object [] {"## ", " % ", " % ", '#', Item.porkRaw, '%', Item.stick});}
public String getVersion()
{
return "1.2.5";
}
}
EnumToolMaterialFlesh
package net.minecraft.src;
public enum EnumToolMaterialFlesh
{
Flesh(0, 59, 2.0F, 0, 15);
private final int harvestLevel;
private final int maxUses;
private final float efficiencyOnProperMaterial;
private final int damageVsEntity;
private final int enchantability;
private EnumToolMaterialFlesh(int par3, int par4, float par5, int par6, int par7)
{
harvestLevel = par3;
maxUses = par4;
efficiencyOnProperMaterial = par5;
damageVsEntity = par6;
enchantability = par7;
}
public int getMaxUses()
{
return maxUses;
}
public float getEfficiencyOnProperMaterial()
{
return efficiencyOnProperMaterial;
}
public int getDamageVsEntity()
{
return damageVsEntity;
}
public int getHarvestLevel()
{
return harvestLevel;
}
public int getEnchantability()
{
return enchantability;
}
}
FleshTool
package net.minecraft.src;
public class FleshTool extends Item
{
private Block blocksEffectiveAgainst[];
protected float efficiencyOnProperMaterial;
private int damageVsEntity;
protected EnumToolMaterialFlesh toolMaterial;
protected FleshTool(int i, int j, EnumToolMaterialFlesh par3EnumToolMaterialFlesh, Block par4ArrayOfBlock[])
{
super(i);
efficiencyOnProperMaterial = 4F;
toolMaterial = par3EnumToolMaterialFlesh;
blocksEffectiveAgainst = par4ArrayOfBlock;
maxStackSize = 1;
setMaxDamage(par3EnumToolMaterialFlesh.getMaxUses());
efficiencyOnProperMaterial = par3EnumToolMaterialFlesh.getEfficiencyOnProperMaterial();
damageVsEntity = j + par3EnumToolMaterialFlesh.getDamageVsEntity();
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
for (int i = 0; i < blocksEffectiveAgainst.length; i++)
{
if (blocksEffectiveAgainst[i] == par2Block)
{
return efficiencyOnProperMaterial;
}
}
return 1.0F;
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(2, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(1, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return damageVsEntity;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return toolMaterial.getEnchantability();
}
}
FleshPickaxe
package net.minecraft.src;
public class FleshPickaxe extends FleshTool
{
private static Block blocksEffectiveAgainst[];
protected FleshPickaxe(int par1, EnumToolMaterialFlesh par2EnumToolMaterialFlesh)
{
super(par1, 2, par2EnumToolMaterialFlesh, blocksEffectiveAgainst);
}
/**
* 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;
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock))
{
return efficiencyOnProperMaterial;
}
else
{
return super.getStrVsBlock(par1ItemStack, par2Block);
}
}
static
{
blocksEffectiveAgainst = (new Block[]
{
Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
Block.railDetector, Block.railPowered
});
}
}
FleshShovel
package net.minecraft.src;
public class FleshShovel extends FleshTool
{
private static Block blocksEffectiveAgainst[];
public FleshShovel(int par1, EnumToolMaterialFlesh par2EnumToolMaterialFlesh)
{
super(par1, 1, par2EnumToolMaterialFlesh, blocksEffectiveAgainst);
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
if (par1Block == Block.snow)
{
return true;
}
return par1Block == Block.blockSnow;
}
static
{
blocksEffectiveAgainst = (new Block[]
{
Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium
});
}
}
FleshAxe
package net.minecraft.src;
public class FleshAxe extends FleshTool
{
private static Block blocksEffectiveAgainst[];
protected FleshAxe(int par1, EnumToolMaterialFlesh par2EnumToolMaterialFlesh)
{
super(par1, 3, par2EnumToolMaterialFlesh, blocksEffectiveAgainst);
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
if (par2Block != null && par2Block.blockMaterial == Material.wood)
{
return efficiencyOnProperMaterial;
}
else
{
return super.getStrVsBlock(par1ItemStack, par2Block);
}
}
static
{
blocksEffectiveAgainst = (new Block[]
{
Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stairDouble, Block.stairSingle, Block.pumpkin, Block.pumpkinLantern, Block.stone
});
}
}
FleshSword
package net.minecraft.src;
public class FleshSword extends Item
{
private int weaponDamage;
private final EnumToolMaterialFlesh toolMaterial;
public FleshSword(int par1, EnumToolMaterialFlesh par2EnumToolMaterialFlesh)
{
super(par1);
toolMaterial = par2EnumToolMaterialFlesh;
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterialFlesh.getMaxUses());
weaponDamage = 4 + par2EnumToolMaterialFlesh.getDamageVsEntity();
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(2, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return weaponDamage;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.block;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 0x11940;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return toolMaterial.getEnchantability();
}
}
FleshHoe
package net.minecraft.src;
public class FleshHoe extends Item
{
public FleshHoe(int par1, EnumToolMaterialFlesh par2EnumToolMaterialFlesh)
{
super(par1);
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterialFlesh.getMaxUses());
}
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7)
{
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6))
{
return false;
}
int i = par3World.getBlockId(par4, par5, par6);
int j = par3World.getBlockId(par4, par5 + 1, par6);
if (par7 != 0 && j == 0 && i == Block.grass.blockID || i == Block.dirt.blockID)
{
Block block = Block.tilledField;
par3World.playSoundEffect((float)par4 + 0.5F, (float)par5 + 0.5F, (float)par6 + 0.5F, block.stepSound.getStepSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
if (par3World.isRemote)
{
return true;
}
else
{
par3World.setBlockWithNotify(par4, par5, par6, block.blockID);
par1ItemStack.damageItem(1, par2EntityPlayer);
return true;
}
}
else
{
return false;
}
}
public boolean isFull3D()
{
return true;
}
}
Cant get it working :/
those id's are already in use, try anything higher than about 2010 or 2020 that might fix it.
so I figured out enough to get EntityLiving entityliving = (EntityLiving)EntityList.createEntityByID(100, par1World);
(not just that I got everything else straightened out) what is par1World? I found it in Entity list but I cannot get what it does.
The thing you guys are looking for is ItemEgg.java if I understand correctly. These are the spawn eggs, monsterplacer is a mob spawner.
I have a suggestion for the "Adding Blocks to the creative menu" section:
I want to have my Items (which are automatically added before the records) and my Blocks (which need to be added manually) in one place, so I do this:
public void load()
{
ModLoader.setInGameHook(this, true, false);
ModLoader.setInGUIHook(this, true, false);
}
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)
{
ArrayList list = (ArrayList)((ContainerCreative)((GuiContainer)guiscreen).inventorySlots).itemList;
ListIterator listIterator = list.listIterator();
int lastItemAddedIndex = list.size()-1;
while (listIterator.hasNext()) {
int index = listIterator.nextIndex();
if (((ItemStack)listIterator.next()).itemID == theLastItemYouCreated.shiftedIndex) { // Need to modify!
lastItemAddedIndex = index;
break;
}
}
ArrayList listAfterLastItem = new ArrayList(list.subList(lastItemAddedIndex + 1, list.size()));
ArrayList listUntilLastItem = new ArrayList(list.subList(0, lastItemAddedIndex + 1));
listUntilLastItem.add(new ItemStack(yourBlockHere));
listUntilLastItem.add(new ItemStack(yourSecondBlockHere)); // Expand as needed
listUntilLastItem.addAll(listAfterLastItem);
((ContainerCreative)((GuiContainer)guiscreen).inventorySlots).itemList = new ArrayList(listUntilLastItem);
}
creativeInventory = guiscreen;
return true;
}
private static GuiScreen creativeInventory;
theLastItemYouCreated is the Item you want your Blocks to be after.
Now you only need to set ModLoader.setInGUIHook in your mod_xyz.load():
Try it! Maybe .setpotionetc.setpotionetc would work, I doubt it but try it
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI don't get errors now...but my alien grass won't turn my alien dirt into alien grass, help?
package net.minecraft.src; import java.util.Random; 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); } } } } }Please post all of your mod files pertaining to the problem, that would help a lot. But first, does the alien dirt get generated?
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumaliengrass.java
package net.minecraft.src; import java.util.Random; 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); } } } } }aliendirt.java
package net.minecraft.src; import java.util.Random; public class aliendirt extends Block { public aliendirt(int i, int j) { super(i, j, Material.wood); } public int idDropped(int i, Random random, int j) { return mod_MangMod.aliendirt.blockID; } public int quantityDropped(Random random) { return 1; }}For your pick it should be public static final Item ShadowPick = new ItemPickaxe(799,EnumToolMaterialShadow
Diamond.ShadowDiamond).setItemName("shadowpick");
well then that means that the if statement is not getting what is required to turn it into aliengrass. Try getting rid of Just as a test, if that turns it all into aliengrass it worked correctly, if not then something is wrong.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumEDIT: Ok, another issue completely unrelated. I just tried compiling my mod then reobing it, and got the reobed folder. I compressed it into a zip, then put it into my mods folder. Nothing changed. Did I do something wrong?
Yes you can, like I said that was just a test to see if it spawned with a variable that should be true if the aliendirt generated. Post your mod file that would help.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiummod_MangMod
package net.minecraft.src; import java.util.Map; import net.minecraft.client.Minecraft; import java.util.List; public class mod_MangMod extends BaseMod { public static final Block aliengrass = new aliengrass(125, 0).setBlockName("aliengrass").setHardness(0.5F).setResistance(4F); public static int aliengrassbottom = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassbottom.png"); public static int aliengrasstop = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrasstop.png"); public static int aliengrassside = ModLoader.addOverride("/terrain.png", "/mangmod/aliengrassside.png"); public static final Block aliendirt = new aliendirt(126, 0).setBlockName("aliendirt").setHardness(0.5F).setResistance(4F); public static final Item glasscup = new Item(5000).setItemName("glasscup"); public static final Item applejuice = new Item(5001).setItemName("applejuice"); public static final Item donut = new ItemFood(5002, 4, 2F, false).setItemName("donut"); public static final Item glazeddonut = new ItemFood(5003, 6, 1F, false).setItemName("glazeddonut"); public static final Item diamondbucket = new Item(5004).setItemName("diamondbucket"); public static final Item orange = new ItemFood(5005, 4, 4F, false).setItemName("orange"); public static final Item bacon = new ItemFood(5006, 9, 1F, false).setItemName("bacon"); public static final Item eggsandwich = new ItemFood(5007, 11, 1F, false).setItemName("eggsandwich"); public static final Item tinyalien = new Item(5008).setItemName("tinyalien"); public static final Item tinyzombie = new Item(5009).setItemName("tinyzombie"); public static final Item alienflesh = new Item(5010).setItemName("alienflesh"); public void load() { ModLoader.registerEntityID(innocentvillager.class, "innocentvillager", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(innocentvillager.class, 5, 1, 1, EnumCreatureType.creature, new BiomeGenBase[] { BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.taiga, BiomeGenBase.taigaHills, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.jungle, BiomeGenBase.jungleHills }); ModLoader.registerEntityID(alienruffian.class, "alienruffian", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(alienruffian.class, 35, 1, 1, EnumCreatureType.creature, new BiomeGenBase[] { mod_AlienBiome.alienbiome }); ModLoader.registerBlock(aliengrass); ModLoader.addName(aliengrass, "Alien Grass"); ModLoader.addRecipe(new ItemStack(aliengrass, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); aliendirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mangmod/aliendirt.png"); ModLoader.registerBlock(aliendirt); ModLoader.addName(aliendirt, "Alien Dirt"); glasscup.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glasscup.png"); ModLoader.addName(glasscup, "Glass Cup"); ModLoader.addRecipe(new ItemStack(glasscup, 1), new Object [] {"# #", "###", Character.valueOf('#'), Block.glass}); applejuice.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/applejuice.png"); ModLoader.addName(applejuice, "Apple Juice"); ModLoader.addRecipe(new ItemStack(applejuice, 1), new Object [] {"#", "#", "%", Character.valueOf('#'), Item.appleRed, Character.valueOf('%'), glasscup}); donut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/donut.png"); ModLoader.addName(donut, "Donut"); ModLoader.addRecipe(new ItemStack(donut, 4), new Object [] {"###", "# #", "###", Character.valueOf('#'), Item.wheat}); glazeddonut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/glazeddonut.png"); ModLoader.addName(glazeddonut, "Glazed Donut"); ModLoader.addRecipe(new ItemStack(glazeddonut, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.sugar, Character.valueOf('%'), donut}); diamondbucket.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/diamondbucket.png"); ModLoader.addName(diamondbucket, "Diamond Bucket"); ModLoader.addRecipe(new ItemStack(diamondbucket, 1), new Object [] {"# #", " # ", Character.valueOf('#'), Item.diamond}); orange.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/orange.png"); ModLoader.addName(orange, "Orange"); bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/bacon.png"); ModLoader.addName(bacon, "Bacon"); ModLoader.addSmelting(Item.porkCooked.shiftedIndex, new ItemStack(bacon, 1)); eggsandwich.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/eggsandwich.png"); ModLoader.addName(eggsandwich, "Egg Sandwich"); ModLoader.addRecipe(new ItemStack(eggsandwich, 1), new Object [] {"#", "%", "#", Character.valueOf('#'), Item.bread, Character.valueOf('%'), Item.egg}); tinyalien.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyalien.png"); ModLoader.addName(tinyalien, "Tiny Alien"); ModLoader.addRecipe(new ItemStack(tinyalien, 1), new Object [] {"#", "%", Character.valueOf('#'), alienflesh, Character.valueOf('%'), Item.diamond}); tinyzombie.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/tinyzombie.png"); ModLoader.addName(tinyzombie, "Tiny Zombie"); ModLoader.addRecipe(new ItemStack(tinyzombie, 1), new Object [] {"#", "%", Character.valueOf('#'), Item.rottenFlesh, Character.valueOf('%'), Item.diamond}); alienflesh.iconIndex = ModLoader.addOverride("/gui/items.png", "/mangmod/alienflesh.png"); ModLoader.addName(alienflesh, "Alien Flesh"); } public void addRenderer(Map map) { map.put(innocentvillager.class, new RenderBiped(new ModelBiped(), 0.5F)); } public String getVersion() { return "1.2.5"; } }Did you install modloader?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI understood you, you misunderstood me. Go dig a hole in grass and watch how the dirt underneath get's converted to grass blocks. That is the code that you edited. If you wanted the grass just to generate you need to put that in your generation class.
Your checklist:
mod_yourmod-have the pick declared and everything-check
ItemSwordDerp-make sure it's the sword code
ItemWhateverSwordTool-You must have this, it's the ItemNamehereTool class
YOU MUST HAVE THOSE THREE FILES-if you have all of them, post the code here and we'll check it out
so I figured out enough to get EntityLiving entityliving = (EntityLiving)EntityList.createEntityByID(100, par1World);
(not just that I got everything else straightened out) what is par1World? I found it in Entity list but I cannot get what it does.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThe grass thing is what I want my alien grass to do, but it won't do that, it just sits there. The custom grass won't grow onto my custom dirt.
those id's are already in use, try anything higher than about 2010 or 2020 that might fix it.
The thing you guys are looking for is ItemEgg.java if I understand correctly. These are the spawn eggs, monsterplacer is a mob spawner.
The way that you have the code now is not going to grow the grass, it's going to set the aliendirt to aliengrass if it has a certain light value.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAlien Grass will convert Alien Dirt into the Alien Grass Block (like Vanilla MC)
And it is not doing that. For some reason, we are both going in circles.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI want to have my Items (which are automatically added before the records) and my Blocks (which need to be added manually) in one place, so I do this:
public void load() { ModLoader.setInGameHook(this, true, false); ModLoader.setInGUIHook(this, true, false); } 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) { ArrayList list = (ArrayList)((ContainerCreative)((GuiContainer)guiscreen).inventorySlots).itemList; ListIterator listIterator = list.listIterator(); int lastItemAddedIndex = list.size()-1; while (listIterator.hasNext()) { int index = listIterator.nextIndex(); if (((ItemStack)listIterator.next()).itemID == theLastItemYouCreated.shiftedIndex) { // Need to modify! lastItemAddedIndex = index; break; } } ArrayList listAfterLastItem = new ArrayList(list.subList(lastItemAddedIndex + 1, list.size())); ArrayList listUntilLastItem = new ArrayList(list.subList(0, lastItemAddedIndex + 1)); listUntilLastItem.add(new ItemStack(yourBlockHere)); listUntilLastItem.add(new ItemStack(yourSecondBlockHere)); // Expand as needed listUntilLastItem.addAll(listAfterLastItem); ((ContainerCreative)((GuiContainer)guiscreen).inventorySlots).itemList = new ArrayList(listUntilLastItem); } creativeInventory = guiscreen; return true; } private static GuiScreen creativeInventory;theLastItemYouCreated is the Item you want your Blocks to be after.
Now you only need to set ModLoader.setInGUIHook in your mod_xyz.load():
Maybe someone finds this helpful.