byte Level.GetTile(int x, int y, int z)
// Get a block from a player's current level at x, y, z coordinates.
byte block = p.level.GetTile(x, y, z);
// Block.IsAir(byte block) returns true if a block is air or op_air; false otherwise.
bool isAir = Block.IsAir(block);
// Check if block is a grass block.
bool isGrass = block == Block.grass;
BlockCatch.CaptureOneBlock(p, 2, DrawCuboid, new BasicDrawArgs(block));
public override void use(Player p, string message)
{
p.ClearBlockchange();
p.Blockchange+=Blockchange;
}
public void Blockchange(Player p, ushort x, ushort y, ushort z, byte type)
{
for(ushort height = y; height<=p.level.height-1; height++)
{
byte b = p.level.GetTile(x,height,z);
//if checking for something { }
p.level.Blockchange(p,x,height,z,type);
}
if(!p.static)
p.ClearBlockchange();
}
Leeizazombie wrote:Thank you Dzienny, it was helpful!
I was able to make it place a pillar at a set height but the problem is that I have to place two blocks to set the spot, I tried:
- Code: Select all
BlockCatch.CaptureOneBlock(p, 2, DrawCuboid, new BasicDrawArgs(block));
No matter what arguments I use it keeps giving errors that the arguments are invalid, I have no idea how to make it capture one block only, can you show an example please?
BlockCatch.CaptureOneBlock(p, DrawPillar, new BasicDrawArgs(block));
BlockCatch.CaptureMultipleBlocks(p, 1, DrawPillar, new BasicDrawArgs(block));
void DrawPillar(Player p, ChangeInfo change, BasicDrawArgs args) { }
void DrawPillar(Player p, List<ChangeInfo> changes, BasicDrawArgs args) { }
Users browsing this forum: No registered users and 1 guest