private static Block DeserializeBlock(string response) { var splitResponse = response.Split(','); return(JavaBlock.Create( (BlockType)int.Parse(splitResponse[0]), byte.Parse(splitResponse[1]))); }
public async Task <IWorld> SetBlocksAsync(Block block, Vector3 corner1, Vector3 corner2) { var javaBlock = JavaBlock.From(block); await Connection.SendAsync( "world.setBlocks", (int)Math.Floor(corner1.X), (int)Math.Floor(corner1.Y), (int)Math.Floor(corner1.Z), (int)Math.Floor(corner2.X), (int)Math.Floor(corner2.Y), (int)Math.Floor(corner2.Z), (byte)javaBlock.Type, javaBlock.Data& 0xF); return(this); }
public async Task <IWorld> SetBlockAsync(Block block, float x, float y, float z) { var javaBlock = JavaBlock.From(block); await Connection.SendAsync( "world.setBlock", (int)Math.Floor(x), (int)Math.Floor(y), (int)Math.Floor(z), (byte)javaBlock.Type, javaBlock.Data& 0xF, "{}"); // Total hack: pass an empty NBT block to force the java mod to go through a codepath that doesn't have commented out code for data. return(this); }