本文整理汇总了C#中SMP.BCS类的典型用法代码示例。如果您正苦于以下问题:C# BCS类的具体用法?C# BCS怎么用?C# BCS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BCS类属于SMP命名空间,在下文中一共展示了BCS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Blockclicked
/// <summary>
/// this one reverses the direction offset and returns the block id that was clicked
/// this does not always need to be used, only if the direction offset has already been applied
/// in the packet handling.
/// </summary>
/// <param name="p"></param>
/// <param name="a"></param>
/// <returns></returns>
public static byte Blockclicked(Player p, BCS a)
{
int x = (int)a.pos.x;
int y = (int)a.pos.y;
int z = (int)a.pos.z;
switch (a.Direction)
{
case 0: y++; break;
case 1: y--; break;
case 2: z++; break;
case 3: z--; break;
case 4: x++; break;
case 5: x--; break;
}
return p.level.GetBlock(x, y, z);
}
示例2: EatCookie
public static bool EatCookie(Player a, BCS b)
{
return false;
}
示例3: PlaceFence
public static bool PlaceFence(Player a, BCS b)
{
return false;
}
示例4: PlaceCake
public static bool PlaceCake(Player a, BCS b)
{
if (a.level.GetBlock((int)b.pos.x, (int)b.pos.y - 1, (int)b.pos.z) != 0)
{
a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, (byte)Blocks.CakeBlock, 0);
return true;
}
return false;
}
示例5: PlaceButtonStone
public static bool PlaceButtonStone(Player a, BCS b)
{
if (!BlockData.CanPlaceAgainst(Blockclicked(a, b))) return false;
if (a.level.GetBlock((int)b.pos.x, (int)b.pos.y, (int)b.pos.z) != 0) return false;
switch (b.Direction)
{
case (0):
case (1):
return false;
case ((byte)Directions.East):
b.Direction = (byte)Buttons.North;
break;
case ((byte)Directions.West):
b.Direction = (byte)Buttons.South;
break;
case ((byte)Directions.North):
b.Direction = (byte)Buttons.East;
break;
case ((byte)Directions.South):
b.Direction = (byte)Buttons.West;
break;
default:
return false;
}
a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, (byte)b.ID, b.Direction);
if (Server.mode == 0) a.inventory.Remove(a.inventory.current_index, 1);
return false;
}
示例6: PlaceBed
public static bool PlaceBed(Player a, BCS b)
{
if (b.Direction != 1) return false;
Point3 pos2 = b.pos;
byte rot = DirectionByRotFlat(a, b);
switch (rot)
{
case (byte)Directions.North:
rot = (byte)Bed.North;
break;
case (byte)Directions.East:
rot = (byte)Bed.East;
break;
case (byte)Directions.South:
rot = (byte)Bed.South;
break;
case (byte)Directions.West:
rot = (byte)Bed.West;
break;
}
switch (rot)
{
case (byte)Bed.North:
pos2.x--;
break;
case (byte)Bed.East:
pos2.z--;
break;
case (byte)Bed.South:
pos2.x++;
break;
case (byte)Bed.West:
pos2.z++;
break;
}
if (!BlockData.CanPlaceAgainst(a.level.GetBlock((int)b.pos.x, (int)b.pos.y - 1, (int)b.pos.z)) || !BlockData.CanPlaceAgainst(a.level.GetBlock((int)pos2.x, (int)pos2.y - 1, (int)pos2.z))) return false;
a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, (byte)Blocks.Bed, rot);
a.level.BlockChange((int)pos2.x, (int)pos2.y, (int)pos2.z, (byte)Blocks.Bed, (byte)(rot | 0x8));
return true;
}
示例7: OpenFurnace
public static bool OpenFurnace(Player a, BCS b)
{
a.OpenWindow(WindowType.Furnace, b.pos);
return false;
}
示例8: OpenDoor
public static bool OpenDoor(Player a, BCS b)
{
byte type = a.level.GetBlock((int)b.pos.x, (int)b.pos.y, (int)b.pos.z);
byte meta = a.level.GetMeta((int)b.pos.x, (int)b.pos.y, (int)b.pos.z);
if ((meta & 0x8) == 0)
{
a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, type, (byte)(meta ^ 0x4));
if (a.level.GetBlock((int)b.pos.x, (int)b.pos.y + 1, (int)b.pos.z) == type)
a.level.BlockChange((int)b.pos.x, (int)b.pos.y + 1, (int)b.pos.z, type, (byte)((meta | 0x8) ^ 0x4));
}
else
{
a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, type, (byte)(meta ^ 0x4));
if (a.level.GetBlock((int)b.pos.x, (int)b.pos.y - 1, (int)b.pos.z) == type)
a.level.BlockChange((int)b.pos.x, (int)b.pos.y - 1, (int)b.pos.z, type, (byte)((meta ^ 0x8) ^ 0x4));
}
Player.GlobalSoundEffect(b.pos, 1003, a.level, a);
return false;
}
示例9: EjectCd
public static bool EjectCd(Player a, BCS b)
{
return false;
}
示例10: EatSoup
public static bool EatSoup(Player a, BCS b)
{
return false;
}
示例11: EatPorkchopRaw
public static bool EatPorkchopRaw(Player a, BCS b)
{
return false;
}
示例12: EatPorkchopCooked
public static bool EatPorkchopCooked(Player a, BCS b)
{
return false;
}
示例13: EatGoldenApple
public static bool EatGoldenApple(Player a, BCS b)
{
return false;
}
示例14: EatFishRaw
public static bool EatFishRaw(Player a, BCS b)
{
return false;
}
示例15: EatFishCooked
public static bool EatFishCooked(Player a, BCS b)
{
return false;
}