protected BlockCFlower(int i, int j)
{
super(i, Material.plants);
blockIndexInTexture = j;
setTickOnLoad(true);
float f = 0.2F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3F, 0.5F + f);
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
return super.canPlaceBlockAt(world, i, j, k) && canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k));
}
protected boolean canThisPlantGrowOnThisBlockID(int i)
{
return i == Block.grass.blockID || i == Block.dirt.blockID || i == Block.tilledField.blockID;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
super.onNeighborBlockChange(world, i, j, k, l);
checkFlowerChange(world, i, j, k);
}
public void updateTick(World world, int i, int j, int k, Random random)
{
checkFlowerChange(world, i, j, k);
}
protected final void checkFlowerChange(World world, int i, int j, int k)
{
if(!canBlockStay(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
public boolean canBlockStay(World world, int i, int j, int k)
{
return (world.getFullBlockLightValue(i, j, k) >= 8 || world.canBlockSeeTheSky(i, j, k)) && canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k));
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
Hello, I am making a new flower for a mod. I got it to generate naturaly and all that, it has its correct texture when sitting on dirt, but once I break it, it looks like a flat greyscale grass texture icon?
Thanks in advance!
This is my code:
package net.minecraft.src;
import java.util.Random;
public class mod_Cyan extends BaseMod
{
public static final Block Flower = new BlockCFlower(148, 0).setHardness(0.0F).setResistance(0F).setBlockName("Flower");
public mod_Cyan()
{
ModLoader.RegisterBlock(Flower);
ModLoader.AddName(Flower, "Cyan Rose");
Flower.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/SAPM/Cyan_Flower.png");
ModLoader.AddRecipe(new ItemStack(Item.dyePowder, 2, 6), new Object[] {
"X", Character.valueOf('X'), mod_Cyan.Flower
});
}
public String Version()
{
return "1.0.0";
}
@Override
public String getVersion() {
return null;
}
@Override
public void load() {
}
public void GenerateSurface(World var1, Random var2, int var3, int var4)
{
int var5;
int var6;
int var7;
int var8;
for(var5 = 0; var5 < 2; ++var5)
{
var6 = var3 + var2.nextInt(16) + 8;
var7 = var2.nextInt(128);
var8 = var4 + var2.nextInt(16) + 8;
(new WorldGenFlowers(mod_Cyan.Flower.blockID)).generate(var1, var2, var6, var7, var8);
}
}
}
IGN: halo291
Age: 13
Why you want to join: Sounds awesome!
Your character (describe backstory etc.):
When the comet hit, my entire gold city of Minepan turned to ice. I, the king of Minepan, the only survivor of Minepan, am now wandering and trying to survive the frozen underground aftermath of the comet. Although, I knew that I would never get my city back, so I became a warrior.
Did you read the backstory? (summarize it):
A comet comes down and freezes the entire planet. Some miners became insane when they came intact with the comet.
Do you have a customized artic skin?:
Yes.
Did you download the TP?(found in other stuff):
Yes.
Did you read the rules?:
Yes.
Hope this is good enough for me to get re-accepted. :smile.gif:
Alright :wink.gif:, but why did your character change?(Just for you backstory)
He thought that he'd never get his city back as it was obliterated/frozen, and want's to live out the rest of his days as a warrior because war flows through his blood. :cool.gif: (He is nice and will not declare war, unless others attack.)
0
It's basicly just BlockFlower.java.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// Block, Material, World, BlockGrass,
// AxisAlignedBB
public class BlockCFlower extends Block
{
protected BlockCFlower(int i, int j)
{
super(i, Material.plants);
blockIndexInTexture = j;
setTickOnLoad(true);
float f = 0.2F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3F, 0.5F + f);
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
return super.canPlaceBlockAt(world, i, j, k) && canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k));
}
protected boolean canThisPlantGrowOnThisBlockID(int i)
{
return i == Block.grass.blockID || i == Block.dirt.blockID || i == Block.tilledField.blockID;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
super.onNeighborBlockChange(world, i, j, k, l);
checkFlowerChange(world, i, j, k);
}
public void updateTick(World world, int i, int j, int k, Random random)
{
checkFlowerChange(world, i, j, k);
}
protected final void checkFlowerChange(World world, int i, int j, int k)
{
if(!canBlockStay(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
public boolean canBlockStay(World world, int i, int j, int k)
{
return (world.getFullBlockLightValue(i, j, k) >= 8 || world.canBlockSeeTheSky(i, j, k)) && canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k));
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public int getRenderType()
{
return 1;
}
}
0
0
This might work.
0
0
Thanks in advance!
This is my code:
0
Age: 13
Why you want to join: Sounds awesome!
Your character (describe backstory etc.):
When the comet hit, my entire gold city of Minepan turned to ice. I, the king of Minepan, the only survivor of Minepan, am now wandering and trying to survive the frozen underground aftermath of the comet. Although, I knew that I would never get my city back, so I became a warrior.
Did you read the backstory? (summarize it):
A comet comes down and freezes the entire planet. Some miners became insane when they came intact with the comet.
Do you have a customized artic skin?:
Yes.
Did you download the TP?(found in other stuff):
Yes.
Did you read the rules?:
Yes.
Hope this is good enough for me to get re-accepted. :smile.gif:
0
Approximately what time will everyone else be able to come in?
0
0
Well, I'm going to bed, so hopefully you guys can get it to work by time I wake up. :smile.gif:
0
Severe?! :ohmy.gif:
0
Here it is.
And this.
0
It's my avatar. I'll try to upload my skin.
0
0
I'm still working on it.
0
He thought that he'd never get his city back as it was obliterated/frozen, and want's to live out the rest of his days as a warrior because war flows through his blood. :cool.gif: (He is nice and will not declare war, unless others attack.)