Exemplo n.º 1
0
 public LiquidTile(LiquidTile tileIn)
 {
     this = tileIn;
 }
Exemplo n.º 2
0
        public override void onPlayerTileChange(PlayerTileChangeEvent Event)
        {
            Player player = Server.GetPlayerByName(Event.Sender.Name);
            bool water = player.PluginData.ContainsKey("water") ? (bool)player.PluginData["water"] : false;
            bool lava = player.PluginData.ContainsKey("lava") ? (bool)player.PluginData["lava"] : false;

            if (player.isInOpList() && (water || lava))
            {
                LiquidTile liquidTile = new LiquidTile(
                    (int)Event.Position.X,
                    (int)Event.Position.Y,
                    Server.tile.At((int)Event.Position.X, (int)Event.Position.Y));

                FillLiquid(liquidTile,
                    water,
                    lava);
            }

            base.onPlayerTileChange(Event);
        }
Exemplo n.º 3
0
 private void FillLiquid(LiquidTile tile, bool water, bool lava)
 {
     if (water)
     {
         tile.tileRef.SetLava(false);
         tile.tileRef.SetLiquid(255);
     }
     else if (lava)
     {
         tile.tileRef.SetLava(true);
         tile.tileRef.SetLiquid(255);
     }
 }