There was an error in this code because of the doubles that were supposed to be ints. Then I tried changing things around and just casting the doubles:
int x = (int) posX;
int y = (int) posY;
int z = (int) posZ;
public boolean interact(EntityPlayer entityplayer)
{
return true;
World.setBlockWithNotify(x, y, z, Block.wood.blockID);
}
now Eclipse is saying that I cannot "make a static reference to a non-static reference"
static int x = posX;
static int y = posY;
static int z = posZ;
public boolean interact(EntityPlayer entityplayer)
{
return true;
World.setBlockWithNotify(x, y, z, Block.wood.blockID);
}
Now it requires that I change the posX, posY, and posZ values to be static in their own base files and it does not fix the original error.
I tried messing around in eclipse, found some relevant code in mob light checks.
You could try something like this:
public boolean interact(EntityPlayer entityplayer)
{
int x = MathHelper.floor_double(posX);
int y = MathHelper.floor_double(boundingBox.minY);
int z = MathHelper.floor_double(posZ);
worldObj.setBlockWithNotify(x, y + 1, z, Block.wood.blockID);
return true;
}
I tried messing around in eclipse, found some relevant code in mob light checks.
You could try something like this:
public boolean interact(EntityPlayer entityplayer)
{
int x = MathHelper.floor_double(posX);
int y = MathHelper.floor_double(boundingBox.minY);
int z = MathHelper.floor_double(posZ);
worldObj.setBlockWithNotify(x, y + 1, z, Block.wood.blockID);
return true;
}
There was an error in this code because of the doubles that were supposed to be ints. Then I tried changing things around and just casting the doubles:
now Eclipse is saying that I cannot "make a static reference to a non-static reference"
Please help!
try:
public boolean interact(EntityPlayer entityplayer)
{
return true;
World.setBlockWithNotify((int)posX, (int)posY, (int)posZ, Block.wood.blockID);
}
Although i haven't coded recently so there may be something else wrong
Now it requires that I change the posX, posY, and posZ values to be static in their own base files and it does not fix the original error.
You could try something like this:
Works for me.
Koni's answer should work.
Thank you so much!
Thanks for helping me!