modLoader 1.2.5
mod_Sprinkeler 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 79d0d60d --------
Generated 6/9/12 5:10 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (i386) version 10.7.4
Java: 1.6.0_31, Apple Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: ATI Radeon X1600 OpenGL Engine version 2.1 ATI-7.0.52, ATI Technologies Inc.
java.lang.NoClassDefFoundError: BaseModMp
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at ModLoader.addMod(ModLoader.java:289)
at ModLoader.readFromModFolder(ModLoader.java:1276)
at ModLoader.init(ModLoader.java:887)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:77)
at ahu.<clinit>(ahu.java:8)
at net.minecraft.client.Minecraft.a(SourceFile:273)
at net.minecraft.client.Minecraft.run(SourceFile:657)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.ClassNotFoundException: BaseModMp
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 31 more
--- END ERROR REPORT d73289ae ----------
Please Help.
Rollback Post to RevisionRollBack
------------------------------
"whatever you do don't die"
package net.minecraft.src;
public class mod_Sprinkeler extends BaseMod{
public static final Material sprinkeler = new MaterialSprinkeler(MapColor.stoneColor);
public static final Block sprinkelerActive = (new BlockSprinkeler(247, false, sprinkeler)).setHardness(0.0F).setBlockName("sprinkeler");
public static final Block sprinkelerTwoActive = (new BlockSprinkelerTwo(250, false, sprinkeler)).setHardness(0.0F).setBlockName("sprinkelerTwo");
public static final Block sprinkelerIdle = (new BlockSprinkeler(252, true, Material.ground)).setHardness(0.0F).setBlockName("sprinkeler");
public static final Block sprinkelerTwoIdle = (new BlockSprinkelerTwo(255, true, Material.ground)).setHardness(0.0F).setBlockName("sprinkelerTwo");
@Override
public String getVersion() {
return "1.2.5";
}
@Override
public void load() {
ModLoader.addName(sprinkelerActive, "Sprinkeler");
ModLoader.registerBlock(sprinkelerActive);
ModLoader.registerBlock(sprinkelerTwoActive);
ModLoader.registerBlock(sprinkelerIdle);
ModLoader.registerBlock(sprinkelerTwoIdle);
ModLoader.addShapelessRecipe(new ItemStack(sprinkelerIdle), new Object[] {Block.dirt});
ModLoader.addShapelessRecipe(new ItemStack(Item.hoeDiamond), new Object[] {sprinkelerIdle});
ModLoader.addShapelessRecipe(new ItemStack(sprinkelerTwoIdle), new Object[] {sprinkelerIdle, sprinkelerIdle});
sprinkelerActive.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Sprinkeler/sprinkeler.png");
sprinkelerTwoActive.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Sprinkeler/sprinkelerTwo.png");
sprinkelerIdle.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Sprinkeler/sprinkeler.png");
sprinkelerTwoIdle.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Sprinkeler/sprinkelerTwo.png");
}
}
BlockSprinkeler
package net.minecraft.src;
import java.util.Random;
public class BlockSprinkeler extends Block
{
/** Whether this lamp block is the powered version. */
private final boolean powered;
public BlockSprinkeler(int par1, boolean par2, Material Material)
{
super(par1, 211, Material);
powered = par2;
}
public boolean renderAsNormalBlock(){
return false;
}
public int getRenderType(){
return 2;
}
public boolean isOpaqueCube()
{
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int i)
{
return null;
}
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3D par5Vec3D, Vec3D par6Vec3D)
{
int i = par1World.getBlockMetadata(par2, par3, par4) & 7;
float f = 0.15F;
if (i == 1)
{
setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f);
}
else if (i == 2)
{
setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f);
}
else if (i == 3)
{
setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
}
else if (i == 4)
{
setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
}
else
{
float f1 = 0.1F;
setBlockBounds(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, 0.6F, 0.5F + f1);
}
return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3D, par6Vec3D);
}
/**
* Called whenever the block is added into the world. Args: world, x, y, z
*/
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
if (powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.scheduleBlockUpdate(par2, par3, par4, blockID, 4);
}
else if (!powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_Sprinkeler.sprinkelerActive.blockID);
}
}
}
/**
* 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)
{
if (!par1World.isRemote)
{
if (powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.scheduleBlockUpdate(par2, par3, par4, blockID, 4);
}
else if (!powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_Sprinkeler.sprinkelerActive.blockID);
}
}
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote && powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_Sprinkeler.sprinkelerIdle.blockID);
}
}
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
{
return true;
}
if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
{
return true;
}
if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
{
return true;
}
if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
{
return true;
}
return canPlaceSprinkelerOn(par1World, par2, par3 - 1, par4);
}
private boolean canPlaceSprinkelerOn(World par1World, int par2, int par3, int par4)
{
if (par1World.isBlockNormalCubeDefault(par2, par3, par4, true))
{
return true;
}
int i = par1World.getBlockId(par2, par3, par4);
if (i == Block.dirt.blockID || i == Block.grass.blockID || i == Block.sand.blockID)
{
return true;
}
if (Block.blocksList[i] != null && (Block.blocksList[i] instanceof BlockStairs))
{
int j = par1World.getBlockMetadata(par2, par3, par4);
if ((4 & j) != 0)
{
return true;
}
}
return false;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_Sprinkeler.sprinkelerIdle.blockID;
}
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!powered)
{
return;
}
int i = par1World.getBlockMetadata(par2, par3, par4);
double d = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.20000000000000001D;
double d1 = (double)((float)par3 + 0.7F) + (double)(par5Random.nextFloat() - 0.5F) * 0.20000000000000001D;
double d2 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.20000000000000001D;
double d3 = 0.2199999988079071D;
double d4 = 0.27000001072883606D;
if (i == 1)
{
par1World.spawnParticle("splash", d - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
}
else if (i == 2)
{
par1World.spawnParticle("splash", d + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
}
else if (i == 3)
{
par1World.spawnParticle("splash", d, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
}
else if (i == 4)
{
par1World.spawnParticle("splash", d, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
}
else
{
par1World.spawnParticle("splash", d, d1, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d, d1, d2, 0.0D, 0.0D, 0.0D);
}
}
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return AxisAlignedBB.getBoundingBoxFromPool(par2 + 0, par3 + 0, par4 + 0, par2 + 1, par3 + 1, par4 + 1);
}
/**
* Is this block (a) opaque and (B) 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;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par1 == 1 && par2 > 0)
{
return blockIndexInTexture - 1;
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (isWaterNearby(par1World, par2, par3, par4) || par1World.canLightningStrikeAt(par2, par3 + 1, par4))
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 7);
}
else
{
int i = par1World.getBlockMetadata(par2, par3, par4);
if (i > 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, i - 1);
}
else if (!isCropsNearby(par1World, par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
}
}
}
/**
* Block's chance to react to an entity falling on it.
*/
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6)
{
if (par1World.rand.nextFloat() < par6 - 0.5F)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
}
}
/**
* returns true if there is at least one cropblock nearby (x-1 to x+1, y+1, z-1 to z+1)
*/
private boolean isCropsNearby(World par1World, int par2, int par3, int par4)
{
int i = 0;
for (int j = par2 - i; j <= par2 + i; j++)
{
for (int k = par4 - i; k <= par4 + i; k++)
{
int l = par1World.getBlockId(j, par3 + 1, k);
if (l == Block.crops.blockID || l == Block.melonStem.blockID || l == Block.pumpkinStem.blockID)
{
return true;
}
}
}
return false;
}
/**
* returns true if there's water nearby (x-4 to x+4, y to y+1, k-4 to k+4)
*/
private boolean isWaterNearby(World par1World, int par2, int par3, int par4)
{
for (int i = par2 - 8; i <= par2 + 8; i++)
{
for (int j = par3; j <= par3 + 1; j++)
{
for (int k = par4 - 18; k <= par4 + 18; k++)
{
if (par1World.getBlockId(i, j, k) == mod_Sprinkeler.sprinkelerActive.blockID)
{
return true;
}
}
}
for (int j = par3; j <= par3 + 1; j++)
{
for (int k = par4 - 32; k <= par4 + 32; k++)
{
if (par1World.getBlockId(i, j, k) == mod_Sprinkeler.sprinkelerTwoActive.blockID)
{
return true;
}
}
}
}
for (int i = par2 - 4; i <= par2 + 4; i++)
{
for (int j = par3; j <= par3 + 1; j++)
{
for (int k = par4 - 4; k <= par4 + 4; k++)
{
if (par1World.getBlockMaterial(i, j, k) == Material.water)
{
return true;
}
}
}
}
return false;
}
/**
* 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)
{
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
Material material = par1World.getBlockMaterial(par2, par3 + 1, par4);
if (material.isSolid())
{
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
}
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.dirt.idDropped(0, par2Random, par3);
}
}
BlockSprinkelerTwo
package net.minecraft.src;
import java.util.Random;
public class BlockSprinkelerTwo extends Block
{
/** Whether this lamp block is the powered version. */
private final boolean powered;
public BlockSprinkelerTwo(int par1, boolean par2, Material Material)
{
super(par1, 211, Material);
powered = par2;
}
public boolean renderAsNormalBlock(){
return false;
}
public int getRenderType(){
return 2;
}
public boolean isOpaqueCube()
{
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int i)
{
return null;
}
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3D par5Vec3D, Vec3D par6Vec3D)
{
int i = par1World.getBlockMetadata(par2, par3, par4) & 7;
float f = 0.15F;
if (i == 1)
{
setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f);
}
else if (i == 2)
{
setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f);
}
else if (i == 3)
{
setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
}
else if (i == 4)
{
setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
}
else
{
float f1 = 0.1F;
setBlockBounds(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, 0.6F, 0.5F + f1);
}
return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3D, par6Vec3D);
}
/**
* Called whenever the block is added into the world. Args: world, x, y, z
*/
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
if (powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.scheduleBlockUpdate(par2, par3, par4, blockID, 4);
}
else if (!powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_Sprinkeler.sprinkelerTwoActive.blockID);
}
}
}
/**
* 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)
{
if (!par1World.isRemote)
{
if (powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.scheduleBlockUpdate(par2, par3, par4, blockID, 4);
}
else if (!powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_Sprinkeler.sprinkelerTwoActive.blockID);
}
}
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote && powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, mod_Sprinkeler.sprinkelerTwoIdle.blockID);
}
}
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
{
return true;
}
if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
{
return true;
}
if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
{
return true;
}
if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
{
return true;
}
return canPlaceSprinkelerOn(par1World, par2, par3 - 1, par4);
}
private boolean canPlaceSprinkelerOn(World par1World, int par2, int par3, int par4)
{
if (par1World.isBlockNormalCubeDefault(par2, par3, par4, true))
{
return true;
}
int i = par1World.getBlockId(par2, par3, par4);
if (i == Block.dirt.blockID || i == Block.grass.blockID || i == Block.sand.blockID)
{
return true;
}
if (Block.blocksList[i] != null && (Block.blocksList[i] instanceof BlockStairs))
{
int j = par1World.getBlockMetadata(par2, par3, par4);
if ((4 & j) != 0)
{
return true;
}
}
return false;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_Sprinkeler.sprinkelerTwoIdle.blockID;
}
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!powered)
{
return;
}
int i = par1World.getBlockMetadata(par2, par3, par4);
double d = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.20000000000000001D;
double d1 = (double)((float)par3 + 0.7F) + (double)(par5Random.nextFloat() - 0.5F) * 0.20000000000000001D;
double d2 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.20000000000000001D;
double d3 = 0.2199999988079071D;
double d4 = 0.27000001072883606D;
if (i == 1)
{
par1World.spawnParticle("splash", d - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
}
else if (i == 2)
{
par1World.spawnParticle("splash", d + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
}
else if (i == 3)
{
par1World.spawnParticle("splash", d, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
}
else if (i == 4)
{
par1World.spawnParticle("splash", d, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
}
else
{
par1World.spawnParticle("splash", d, d1, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("splash", d, d1, d2, 0.0D, 0.0D, 0.0D);
}
}
}
Rollback Post to RevisionRollBack
------------------------------
"whatever you do don't die"
Please Help.
"whatever you do don't die"
mod_Sprinkeler
package net.minecraft.src;
import java.util.Random;
public class BlockFarmland extends Block
{
protected BlockFarmland(int par1)
{
super(par1, Material.ground);
blockIndexInTexture = 87;
setTickRandomly(true);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F);
setLightOpacity(255);
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return AxisAlignedBB.getBoundingBoxFromPool(par2 + 0, par3 + 0, par4 + 0, par2 + 1, par3 + 1, par4 + 1);
}
/**
* Is this block (a) opaque and (B) 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;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par1 == 1 && par2 > 0)
{
return blockIndexInTexture - 1;
}
if (par1 == 1)
{
return blockIndexInTexture;
}
else
{
return 2;
}
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (isWaterNearby(par1World, par2, par3, par4) || par1World.canLightningStrikeAt(par2, par3 + 1, par4))
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 7);
}
else
{
int i = par1World.getBlockMetadata(par2, par3, par4);
if (i > 0)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, i - 1);
}
else if (!isCropsNearby(par1World, par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
}
}
}
/**
* Block's chance to react to an entity falling on it.
*/
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6)
{
if (par1World.rand.nextFloat() < par6 - 0.5F)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
}
}
/**
* returns true if there is at least one cropblock nearby (x-1 to x+1, y+1, z-1 to z+1)
*/
private boolean isCropsNearby(World par1World, int par2, int par3, int par4)
{
int i = 0;
for (int j = par2 - i; j <= par2 + i; j++)
{
for (int k = par4 - i; k <= par4 + i; k++)
{
int l = par1World.getBlockId(j, par3 + 1, k);
if (l == Block.crops.blockID || l == Block.melonStem.blockID || l == Block.pumpkinStem.blockID)
{
return true;
}
}
}
return false;
}
/**
* returns true if there's water nearby (x-4 to x+4, y to y+1, k-4 to k+4)
*/
private boolean isWaterNearby(World par1World, int par2, int par3, int par4)
{
for (int i = par2 - 8; i <= par2 + 8; i++)
{
for (int j = par3; j <= par3 + 1; j++)
{
for (int k = par4 - 18; k <= par4 + 18; k++)
{
if (par1World.getBlockId(i, j, k) == mod_Sprinkeler.sprinkelerActive.blockID)
{
return true;
}
}
}
for (int j = par3; j <= par3 + 1; j++)
{
for (int k = par4 - 32; k <= par4 + 32; k++)
{
if (par1World.getBlockId(i, j, k) == mod_Sprinkeler.sprinkelerTwoActive.blockID)
{
return true;
}
}
}
}
for (int i = par2 - 4; i <= par2 + 4; i++)
{
for (int j = par3; j <= par3 + 1; j++)
{
for (int k = par4 - 4; k <= par4 + 4; k++)
{
if (par1World.getBlockMaterial(i, j, k) == Material.water)
{
return true;
}
}
}
}
return false;
}
/**
* 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)
{
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
Material material = par1World.getBlockMaterial(par2, par3 + 1, par4);
if (material.isSolid())
{
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
}
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.dirt.idDropped(0, par2Random, par3);
}
}
"whatever you do don't die"
"whatever you do don't die"